add explicit_iter_loop clippy lint (#8570)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Thomas Coratger
2024-06-03 20:14:50 +02:00
committed by GitHub
parent 6e446084f0
commit 2b4fa96065
47 changed files with 79 additions and 78 deletions

View File

@ -78,7 +78,7 @@ fn bench_put_rand(c: &mut Criterion) {
c.bench_function("bench_put_rand", |b| {
b.iter(|| {
let txn = env.begin_rw_txn().unwrap();
for (key, data) in items.iter() {
for (key, data) in &items {
txn.put(db.dbi(), key, data, WriteFlags::empty()).unwrap();
}
})
@ -104,7 +104,7 @@ fn bench_put_rand_raw(c: &mut Criterion) {
mdbx_txn_begin_ex(env, ptr::null_mut(), 0, &mut txn, ptr::null_mut());
let mut i: ::libc::c_int = 0;
for (key, data) in items.iter() {
for (key, data) in &items {
key_val.iov_len = key.len() as size_t;
key_val.iov_base = key.as_bytes().as_ptr() as *mut _;
data_val.iov_len = data.len() as size_t;

View File

@ -211,7 +211,7 @@ mod read_transactions {
// Iterate through active read transactions and time out those that's open for
// longer than `self.max_duration`.
for entry in self.active.iter() {
for entry in &self.active {
let (tx, start) = entry.value();
let duration = now - *start;