Fix clippy lints (#12094)

Fixes clippy lints in `benchmarks.rs`.
This commit is contained in:
Ian Manske 2024-03-07 03:50:58 +00:00 committed by GitHub
parent a18de999c2
commit 7cb13ee734
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -68,7 +68,7 @@ mod parser_benchmarks {
bencher bencher
.with_inputs(|| nu_protocol::engine::StateWorkingSet::new(&engine_state)) .with_inputs(|| nu_protocol::engine::StateWorkingSet::new(&engine_state))
.bench_refs(|mut working_set| parse(&mut working_set, None, default_env, false)) .bench_refs(|working_set| parse(working_set, None, default_env, false))
} }
#[divan::bench()] #[divan::bench()]
@ -78,7 +78,7 @@ mod parser_benchmarks {
bencher bencher
.with_inputs(|| nu_protocol::engine::StateWorkingSet::new(&engine_state)) .with_inputs(|| nu_protocol::engine::StateWorkingSet::new(&engine_state))
.bench_refs(|mut working_set| parse(&mut working_set, None, default_env, false)) .bench_refs(|working_set| parse(working_set, None, default_env, false))
} }
} }
@ -146,7 +146,7 @@ mod encoding_benchmarks {
); );
let encoder = EncodingType::try_from_bytes(b"json").unwrap(); let encoder = EncodingType::try_from_bytes(b"json").unwrap();
bencher bencher
.with_inputs(|| (vec![])) .with_inputs(Vec::new)
.bench_values(|mut res| encoder.encode(&test_data, &mut res)) .bench_values(|mut res| encoder.encode(&test_data, &mut res))
} }
@ -158,7 +158,7 @@ mod encoding_benchmarks {
); );
let encoder = EncodingType::try_from_bytes(b"msgpack").unwrap(); let encoder = EncodingType::try_from_bytes(b"msgpack").unwrap();
bencher bencher
.with_inputs(|| (vec![])) .with_inputs(Vec::new)
.bench_values(|mut res| encoder.encode(&test_data, &mut res)) .bench_values(|mut res| encoder.encode(&test_data, &mut res))
} }
} }