Skip to content

Commit

Permalink
Fix compilation of command bench
Browse files Browse the repository at this point in the history
  • Loading branch information
Erk- committed Sep 17, 2020
1 parent 05f3f22 commit de1610e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions command-parser/benches/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use patricia_tree::PatriciaSet;
use std::{
borrow::Cow,
collections::{BTreeSet, HashSet},
iter::FromIterator,
};

fn btreeset(set: &BTreeSet<Cow<'static, str>>, needle: &str) {
Expand Down Expand Up @@ -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() {
Expand All @@ -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));
Expand Down

0 comments on commit de1610e

Please # to comment.