mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Fix clippy warnings for use of .clone()
warning: assigning the result of `Clone::clone()` may be inefficient
--> vmm/src/device_manager.rs:4188:17
|
4188 | id = child_id.clone();
| ^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `id.clone_from(child_id)`
|
= 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:
@@ -175,7 +175,7 @@ mod tests {
|
||||
|
||||
// Check get_mut()
|
||||
let node = device_tree.get_mut(&id).unwrap();
|
||||
node.id = id2.clone();
|
||||
node.id.clone_from(&id2);
|
||||
let node = device_tree.0.get(&id).unwrap();
|
||||
assert_eq!(node.id, id2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user