From e25a47b32c4a34061c3f1a2914291f6b45360a03 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 19 Dec 2019 17:02:36 +0000 Subject: [PATCH] vmm: device_manager: Remove redundant clones Address updated clippy errors: error: redundant clone --> vmm/src/device_manager.rs:699:32 | 699 | .insert(acpi_device.clone(), 0x3c0, 0x4) | ^^^^^^^^ help: remove this | = note: `-D clippy::redundant-clone` implied by `-D warnings` note: this value is dropped without further use --> vmm/src/device_manager.rs:699:21 | 699 | .insert(acpi_device.clone(), 0x3c0, 0x4) | ^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone error: redundant clone --> vmm/src/device_manager.rs:737:26 | 737 | .insert(i8042.clone(), 0x61, 0x4) | ^^^^^^^^ help: remove this | note: this value is dropped without further use --> vmm/src/device_manager.rs:737:21 | 737 | .insert(i8042.clone(), 0x61, 0x4) | ^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone error: redundant clone --> vmm/src/device_manager.rs:754:29 | 754 | .insert(cmos.clone(), 0x70, 0x2) | ^^^^^^^^ help: remove this | note: this value is dropped without further use --> vmm/src/device_manager.rs:754:25 | 754 | .insert(cmos.clone(), 0x70, 0x2) | ^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone Signed-off-by: Rob Bradford --- vmm/src/device_manager.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vmm/src/device_manager.rs b/vmm/src/device_manager.rs index cecbb5fd4..68fb409e0 100644 --- a/vmm/src/device_manager.rs +++ b/vmm/src/device_manager.rs @@ -696,7 +696,7 @@ impl DeviceManager { address_manager .io_bus - .insert(acpi_device.clone(), 0x3c0, 0x4) + .insert(acpi_device, 0x3c0, 0x4) .map_err(DeviceManagerError::BusError)?; let ged_irq = address_manager @@ -734,7 +734,7 @@ impl DeviceManager { address_manager .io_bus - .insert(i8042.clone(), 0x61, 0x4) + .insert(i8042, 0x61, 0x4) .map_err(DeviceManagerError::BusError)?; #[cfg(feature = "cmos")] { @@ -751,7 +751,7 @@ impl DeviceManager { address_manager .io_bus - .insert(cmos.clone(), 0x70, 0x2) + .insert(cmos, 0x70, 0x2) .map_err(DeviceManagerError::BusError)?; }