From 660c9a4d722984ce42eee27d81a156efdc9912c8 Mon Sep 17 00:00:00 2001 From: Tristan Guichaoua Date: Sat, 24 Feb 2024 15:14:29 +0100 Subject: [PATCH] convert last `HashMap` --- tools/build-templated-pages/src/examples.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/build-templated-pages/src/examples.rs b/tools/build-templated-pages/src/examples.rs index 63370fbee2dcc..873765a6f324e 100644 --- a/tools/build-templated-pages/src/examples.rs +++ b/tools/build-templated-pages/src/examples.rs @@ -109,14 +109,13 @@ pub(crate) fn check(what_to_run: Command) { let categories = parse_categories(); let examples_by_category: HashMap, Category> = examples .into_iter() - .fold(HashMap::>::new(), |mut v, ex| { - v.entry(ex.category.clone()).or_default().push(ex); + .fold(HashMap::, Vec>::new(), |mut v, ex| { + v.entry(ex.category.as_str().into()).or_default().push(ex); v }) .into_iter() .map(|(key, mut examples)| { examples.sort(); - let key = key.into_boxed_str(); let description = categories.get(&key).cloned(); ( key,