From 364763e039b286774c29c4995df6baba9d22a61a Mon Sep 17 00:00:00 2001 From: WriterV2 Date: Sun, 24 Nov 2024 12:17:32 +0100 Subject: Perf: Avoid unnecessary heap allocations of strings --- src/db/product.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/db/product.rs') diff --git a/src/db/product.rs b/src/db/product.rs index c21734e..1c8be1f 100644 --- a/src/db/product.rs +++ b/src/db/product.rs @@ -18,7 +18,7 @@ pub struct Product { } impl Product { - pub async fn post(tx: &mut Transaction<'static, Sqlite>, name: String, description: String, tags: Vec) -> Result { + pub async fn post(tx: &mut Transaction<'static, Sqlite>, name: &str, description: &str, tags: Vec<&str>) -> Result { let now = SystemTime::now().duration_since(std::time::UNIX_EPOCH)?.as_millis() as i64; let product = sqlx::query_as!( Product, -- cgit v1.2.3