mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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 <rbradford@rivosinc.com>
This commit is contained in:
@@ -210,7 +210,7 @@ impl PciDevice for PvPanicDevice {
|
||||
}
|
||||
|
||||
bars.push(bar);
|
||||
self.bar_regions = bars.clone();
|
||||
self.bar_regions.clone_from(&bars);
|
||||
|
||||
Ok(bars)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user