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
.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()]
@ -78,7 +78,7 @@ mod parser_benchmarks {
bencher
.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();
bencher
.with_inputs(|| (vec![]))
.with_inputs(Vec::new)
.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();
bencher
.with_inputs(|| (vec![]))
.with_inputs(Vec::new)
.bench_values(|mut res| encoder.encode(&test_data, &mut res))
}
}