Skip to content

Commit

Permalink
fix: missing closing parenthesis in examples (#585)
Browse files Browse the repository at this point in the history
user_guide/advanced_configuration was missing closing parenthesis when calling bench_function
  • Loading branch information
erwanvivien committed Jul 2, 2022
1 parent b61121b commit a2b8cae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions book/src/user_guide/advanced_configuration.md
Expand Up @@ -20,7 +20,7 @@ fn bench(c: &mut Criterion) {
// Configure Criterion.rs to detect smaller differences and increase sample size to improve
// precision and counteract the resulting noise.
group.significance_level(0.1).sample_size(500);
group.bench_function("my-function", |b| b.iter(|| my_function());
group.bench_function("my-function", |b| b.iter(|| my_function()));
group.finish();
}

Expand All @@ -40,7 +40,7 @@ fn my_function() {

fn bench(c: &mut Criterion) {
let mut group = c.benchmark_group("sample-size-example");
group.bench_function("my-function", |b| b.iter(|| my_function());
group.bench_function("my-function", |b| b.iter(|| my_function()));
group.finish();
}

Expand Down Expand Up @@ -182,10 +182,10 @@ fn my_function() {
fn bench(c: &mut Criterion) {
let mut group = c.benchmark_group("flat-sampling-example");
group.sampling_mode(SamplingMode::Flat);
group.bench_function("my-function", |b| b.iter(|| my_function());
group.bench_function("my-function", |b| b.iter(|| my_function()));
group.finish();
}

criterion_group!(benches, bench);
criterion_main!(benches);
```
```

0 comments on commit a2b8cae

Please sign in to comment.