diff --git a/command-parser/benches/commands.rs b/command-parser/benches/commands.rs index c61d526355c..c2791e3c17f 100644 --- a/command-parser/benches/commands.rs +++ b/command-parser/benches/commands.rs @@ -3,6 +3,7 @@ use patricia_tree::PatriciaSet; use std::{ borrow::Cow, collections::{BTreeSet, HashSet}, + iter::FromIterator, }; fn btreeset(set: &BTreeSet>, needle: &str) { @@ -77,7 +78,7 @@ fn criterion_benchmark(c: &mut Criterion) { ]; c.bench_function("c: btreeset", |b| { - let mut set = BTreeSet::from_iter(commands.iter().map(Cow::from)); + let set = BTreeSet::from_iter(commands.iter().map(|e| Cow::from(*e))); b.iter(|| { for command in commands.iter() { @@ -87,7 +88,7 @@ fn criterion_benchmark(c: &mut Criterion) { }); c.bench_function("c: hashset", |b| { - let mut set = HashSet::from_iter(commands.iter().map(Cow::from)); + let set = HashSet::from_iter(commands.iter().map(|e| Cow::from(*e))); for e in commands.iter() { set.insert(Cow::from(*e));