Skip to content

Commit 0396026

Browse files
committed
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 <[email protected]>
1 parent 6c70ece commit 0396026

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/vmm/benches/queue.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub fn queue_benchmark(c: &mut Criterion) {
6464
let desc = queue.pop().unwrap();
6565
c.bench_function("next_descriptor_1", |b| {
6666
b.iter(|| {
67-
let mut head = Some(desc.clone());
67+
let mut head = Some(desc);
6868
while let Some(d) = head {
6969
head = std::hint::black_box(d.next_descriptor());
7070
}
@@ -76,7 +76,7 @@ pub fn queue_benchmark(c: &mut Criterion) {
7676
let desc = queue.pop().unwrap();
7777
c.bench_function("next_descriptor_2", |b| {
7878
b.iter(|| {
79-
let mut head = Some(desc.clone());
79+
let mut head = Some(desc);
8080
while let Some(d) = head {
8181
head = std::hint::black_box(d.next_descriptor());
8282
}
@@ -88,7 +88,7 @@ pub fn queue_benchmark(c: &mut Criterion) {
8888
let desc = queue.pop().unwrap();
8989
c.bench_function("next_descriptor_4", |b| {
9090
b.iter(|| {
91-
let mut head = Some(desc.clone());
91+
let mut head = Some(desc);
9292
while let Some(d) = head {
9393
head = std::hint::black_box(d.next_descriptor());
9494
}
@@ -100,7 +100,7 @@ pub fn queue_benchmark(c: &mut Criterion) {
100100
let desc = queue.pop().unwrap();
101101
c.bench_function("next_descriptor_16", |b| {
102102
b.iter(|| {
103-
let mut head = Some(desc.clone());
103+
let mut head = Some(desc);
104104
while let Some(d) = head {
105105
head = std::hint::black_box(d.next_descriptor());
106106
}

0 commit comments

Comments
 (0)