mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 05:35:20 +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:
parent
89ff0627e6
commit
f1856bb27c
@ -210,7 +210,7 @@ impl PciDevice for PvPanicDevice {
|
||||
}
|
||||
|
||||
bars.push(bar);
|
||||
self.bar_regions = bars.clone();
|
||||
self.bar_regions.clone_from(&bars);
|
||||
|
||||
Ok(bars)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user