clippy: Address the issue 'needless-borrow'

Issue from beta verion of clippy:

Error:    --> vm-virtio/src/queue.rs:700:59
    |
700 |             if let Some(used_event) = self.get_used_event(&mem) {
    |                                                           ^^^^ help: change this to: `mem`
    |
    = note: `-D clippy::needless-borrow` implied by `-D warnings`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
Bo Chen
2021-06-23 13:42:17 -07:00
committed by Sebastien Boeuf
parent 585269ecb9
commit 5825ab2dd4
30 changed files with 74 additions and 74 deletions

View File

@@ -3159,7 +3159,7 @@ impl DeviceManager {
device_cfg: &mut DeviceConfig,
) -> DeviceManagerResult<PciDeviceInfo> {
let pci = if let Some(pci_bus) = &self.pci_bus {
Arc::clone(&pci_bus)
Arc::clone(pci_bus)
} else {
return Err(DeviceManagerError::NoPciBus);
};
@@ -3235,7 +3235,7 @@ impl DeviceManager {
pub fn eject_device(&mut self, device_id: u8) -> DeviceManagerResult<()> {
// Retrieve the PCI bus.
let pci = if let Some(pci_bus) = &self.pci_bus {
Arc::clone(&pci_bus)
Arc::clone(pci_bus)
} else {
return Err(DeviceManagerError::NoPciBus);
};
@@ -3382,7 +3382,7 @@ impl DeviceManager {
}
let pci = if let Some(pci_bus) = &self.pci_bus {
Arc::clone(&pci_bus)
Arc::clone(pci_bus)
} else {
return Err(DeviceManagerError::NoPciBus);
};
@@ -4049,7 +4049,7 @@ impl BusDevice for DeviceManager {
B0EJ_FIELD_OFFSET => {
assert!(data.len() == B0EJ_FIELD_SIZE);
let mut data_array: [u8; 4] = [0, 0, 0, 0];
data_array.copy_from_slice(&data);
data_array.copy_from_slice(data);
let device_bitmap = u32::from_le_bytes(data_array);
for device_id in 0..32 {