diff --git a/book/src/user_guide/advanced_configuration.md b/book/src/user_guide/advanced_configuration.md index d7be9bca..4f529005 100644 --- a/book/src/user_guide/advanced_configuration.md +++ b/book/src/user_guide/advanced_configuration.md @@ -100,8 +100,8 @@ fn bench(c: &mut Criterion) { let mut group = c.benchmark_group("throughput-example"); for (i, elements) in [elements_1, elements_2].iter().enumerate() { - group.throughput(Throughput::Elements(elems.len() as u64)); - group.bench_with_input(format!("Encode {}", i), elements, |elems, b| { + group.throughput(Throughput::Elements(elements.len() as u64)); + group.bench_with_input(format!("Encode {}", i), elements, |b, elems| { b.iter(||encode(elems)) }); }