Skip to content

Commit 8d8383e

Browse files
committed
boot/categories: Avoid unnecessary allocations
1 parent 8cb6110 commit 8d8383e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/boot/categories.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ impl Category {
1919
fn from_parent(
2020
slug: &str,
2121
name: &str,
22-
description: &str,
22+
description: String,
2323
parent: Option<&Category>,
2424
) -> Category {
2525
match parent {
2626
Some(parent) => Category {
2727
slug: format!("{}::{}", parent.slug, slug),
2828
name: format!("{}::{}", parent.name, name),
29-
description: description.into(),
29+
description,
3030
},
3131
None => Category {
3232
slug: slug.into(),
3333
name: name.into(),
34-
description: description.into(),
34+
description,
3535
},
3636
}
3737
}
@@ -68,7 +68,7 @@ fn categories_from_toml(
6868
let category = Category::from_parent(
6969
slug,
7070
required_string_from_toml(details, "name")?,
71-
&description,
71+
description,
7272
parent,
7373
);
7474

0 commit comments

Comments
 (0)