Skip to content

Commit

Permalink
test: fix compile of benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
Armin Becher authored and becheran committed Oct 27, 2023
1 parent 1ec98f4 commit fcbfadc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions benches/benches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn criterion_benchmark(c: &mut Criterion) {
let grid = init_grid();
b.iter_batched(
|| (rand(), rand()),
|(x, y)| grid[x][y],
|(x, y)| grid[(x, y)],
criterion::BatchSize::SmallInput,
)
});
Expand Down Expand Up @@ -117,7 +117,7 @@ fn criterion_benchmark(c: &mut Criterion) {
let mut g = init_grid();
b.iter_batched(
|| (rand(), rand()),
|(x, y)| g[x][y] = 42,
|(x, y)| g[(x, y)] = 42,
criterion::BatchSize::SmallInput,
)
});
Expand Down Expand Up @@ -181,23 +181,23 @@ fn criterion_benchmark(c: &mut Criterion) {
let grid = init_grid();
b.iter_batched(
|| grid.clone(),
|g| g.rotate_left(),
|mut g| g.rotate_left(),
criterion::BatchSize::SmallInput,
)
});
c.bench_function("grid_rotate_right", |b| {
let grid = init_grid();
b.iter_batched(
|| grid.clone(),
|g| g.rotate_right(),
|mut g| g.rotate_right(),
criterion::BatchSize::SmallInput,
)
});
c.bench_function("grid_rotate_half", |b| {
let grid = init_grid();
b.iter_batched(
|| grid.clone(),
|g| g.rotate_half(),
|mut g| g.rotate_half(),
criterion::BatchSize::SmallInput,
)
});
Expand Down

0 comments on commit fcbfadc

Please sign in to comment.