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/story.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/db/story.rs') diff --git a/src/db/story.rs b/src/db/story.rs index 9e5fdb9..5803351 100644 --- a/src/db/story.rs +++ b/src/db/story.rs @@ -76,9 +76,9 @@ impl ProductDatabaseHandler for Story { async fn post( &self, pool: &SqlitePool, - name: String, - description: String, - tags: Vec, + name: &str, + description: &str, + tags: Vec<&str>, ) -> Result where Self: Sized, @@ -114,13 +114,13 @@ impl ProductDatabaseHandler for Story { } } -impl PageBuilder for Story { - fn page_title() -> String { - "Stories".to_string() +impl<'a> PageBuilder<'a> for Story { + fn page_title() -> &'a str { + "Stories" } // TODO: Add pdf and epub icons - fn product_specific_card_content( + fn product_specific_card_content + ProductMarker>( &self, specific_product: &super::product::SpecificProduct, ) -> maud::Markup { -- cgit v1.2.3