Skip to content

Commit

Permalink
Fix errors/warnings in benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-hansen committed Jun 24, 2023
1 parent ac1a7ae commit 159a88e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion benches/action_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn criterion_benchmark(c: &mut Criterion) {
let action_state = ActionState::<TestAction>::default();

c.bench_function("action_state_default", |b| {
b.iter(|| ActionState::<TestAction>::default())
b.iter(ActionState::<TestAction>::default)
});
c.bench_function("pressed", |b| b.iter(|| pressed(&action_state)));
c.bench_function("just_pressed", |b| b.iter(|| just_pressed(&action_state)));
Expand Down
8 changes: 4 additions & 4 deletions benches/input_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use criterion::{black_box, criterion_group, criterion_main, Criterion};
use leafwing_input_manager::{
action_state::ActionData,
input_streams::InputStreams,
prelude::{ClashStrategy, InputMap, MockInput},
prelude::{ClashStrategy, InputMap},
Actionlike,
};

Expand Down Expand Up @@ -64,10 +64,10 @@ fn which_pressed(input_streams: &InputStreams, clash_strategy: ClashStrategy) ->

pub fn criterion_benchmark(c: &mut Criterion) {
c.bench_function("construct_input_map_from_iter", |b| {
b.iter(|| construct_input_map_from_iter())
b.iter(construct_input_map_from_iter)
});
c.bench_function("construct_input_map_from_chained_calls", |b| {
b.iter(|| construct_input_map_from_chained_calls())
b.iter(construct_input_map_from_chained_calls)
});
let mut which_pressed_group = c.benchmark_group("which_pressed");

Expand All @@ -79,7 +79,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {

app.update();

let input_streams = InputStreams::from_world(&app.world, None);
let input_streams = InputStreams::from_world(&app.world);

for clash_strategy in ClashStrategy::variants() {
which_pressed_group.bench_function(format!("{:?}", clash_strategy), |b| {
Expand Down

0 comments on commit 159a88e

Please sign in to comment.