Fix clippy lints (#12139)

Fixes clippy lints in `benchmarks.rs`.
This commit is contained in:
Ian Manske 2024-03-09 17:23:32 +00:00 committed by GitHub
parent d05f94e5fc
commit c6d4e4f890
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -204,7 +204,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()]
@ -214,7 +214,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))
} }
} }
@ -282,7 +282,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))
} }
@ -294,7 +294,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))
} }
} }