diff options
| author | WriterV2 <primary-v2@protonmail.com> | 2024-11-24 12:17:32 +0100 |
|---|---|---|
| committer | WriterV2 <primary-v2@protonmail.com> | 2024-11-24 12:17:32 +0100 |
| commit | 364763e039b286774c29c4995df6baba9d22a61a (patch) | |
| tree | 479549136d47ae4ed0e5ceb6acffaf94a110bc47 /src/db/product.rs | |
| parent | 680867b4bb5e2708f02fc3f8c21c3563975c44c7 (diff) | |
Perf: Avoid unnecessary heap allocations of strings
Diffstat (limited to 'src/db/product.rs')
| -rw-r--r-- | src/db/product.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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<String>) -> Result<Product, AppError> { + pub async fn post(tx: &mut Transaction<'static, Sqlite>, name: &str, description: &str, tags: Vec<&str>) -> Result<Product, AppError> { let now = SystemTime::now().duration_since(std::time::UNIX_EPOCH)?.as_millis() as i64; let product = sqlx::query_as!( Product, |
