From 03960262ac7ec9ecc597fdf98674f31e708f3b9f Mon Sep 17 00:00:00 2001 From: Patrick Roy Date: Fri, 13 Sep 2024 14:26:47 +0100 Subject: [PATCH] fix: bench: Eliminate unneeded `.clone()`s Clippy insists and my pre-commit hook keeps trying to add this to random commits. Signed-off-by: Patrick Roy --- src/vmm/benches/queue.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vmm/benches/queue.rs b/src/vmm/benches/queue.rs index 9724e8227e4..de4e94ee27f 100644 --- a/src/vmm/benches/queue.rs +++ b/src/vmm/benches/queue.rs @@ -64,7 +64,7 @@ pub fn queue_benchmark(c: &mut Criterion) { let desc = queue.pop().unwrap(); c.bench_function("next_descriptor_1", |b| { b.iter(|| { - let mut head = Some(desc.clone()); + let mut head = Some(desc); while let Some(d) = head { head = std::hint::black_box(d.next_descriptor()); } @@ -76,7 +76,7 @@ pub fn queue_benchmark(c: &mut Criterion) { let desc = queue.pop().unwrap(); c.bench_function("next_descriptor_2", |b| { b.iter(|| { - let mut head = Some(desc.clone()); + let mut head = Some(desc); while let Some(d) = head { head = std::hint::black_box(d.next_descriptor()); } @@ -88,7 +88,7 @@ pub fn queue_benchmark(c: &mut Criterion) { let desc = queue.pop().unwrap(); c.bench_function("next_descriptor_4", |b| { b.iter(|| { - let mut head = Some(desc.clone()); + let mut head = Some(desc); while let Some(d) = head { head = std::hint::black_box(d.next_descriptor()); } @@ -100,7 +100,7 @@ pub fn queue_benchmark(c: &mut Criterion) { let desc = queue.pop().unwrap(); c.bench_function("next_descriptor_16", |b| { b.iter(|| { - let mut head = Some(desc.clone()); + let mut head = Some(desc); while let Some(d) = head { head = std::hint::black_box(d.next_descriptor()); }