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:
Rob Bradford 2024-03-19 16:32:27 +00:00 committed by Bo Chen
parent 89ff0627e6
commit f1856bb27c

View File

@ -210,7 +210,7 @@ impl PciDevice for PvPanicDevice {
}
bars.push(bar);
self.bar_regions = bars.clone();
self.bar_regions.clone_from(&bars);
Ok(bars)
}