From f1856bb27c041a42bd94fa77bc3c318d69275a6b Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 19 Mar 2024 16:32:27 +0000 Subject: [PATCH] devices: Fix clippy warning for use of .clone() warning: assigning the result of `Clone::clone()` may be inefficient --> devices/src/pvpanic.rs:213:9 | 213 | self.bar_regions = bars.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `self.bar_regions.clone_from(&bars)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones = note: `#[warn(clippy::assigning_clones)]` on by default Signed-off-by: Rob Bradford --- devices/src/pvpanic.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices/src/pvpanic.rs b/devices/src/pvpanic.rs index 57a26310e..a3e82f8fb 100644 --- a/devices/src/pvpanic.rs +++ b/devices/src/pvpanic.rs @@ -210,7 +210,7 @@ impl PciDevice for PvPanicDevice { } bars.push(bar); - self.bar_regions = bars.clone(); + self.bar_regions.clone_from(&bars); Ok(bars) }