Skip to content

Commit

Permalink
convert last HashMap<String,_>
Browse files Browse the repository at this point in the history
  • Loading branch information
tguichaoua committed Feb 24, 2024
1 parent c13f828 commit 660c9a4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tools/build-templated-pages/src/examples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,13 @@ pub(crate) fn check(what_to_run: Command) {
let categories = parse_categories();
let examples_by_category: HashMap<Box<str>, Category> = examples
.into_iter()
.fold(HashMap::<String, Vec<Example>>::new(), |mut v, ex| {
v.entry(ex.category.clone()).or_default().push(ex);
.fold(HashMap::<Box<str>, Vec<Example>>::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,
Expand Down

0 comments on commit 660c9a4

Please sign in to comment.