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

@@ -652,7 +652,7 @@ impl VirtioPciDevice {
if offset < std::mem::size_of::<VirtioPciCap>() {
let (_, right) = cap_slice.split_at_mut(offset);
right[..data_len].copy_from_slice(&data);
right[..data_len].copy_from_slice(data);
None
} else {
// Safe since we know self.cap_pci_cfg_info.cap.cap.offset is 32bits long.

View File

@@ -302,7 +302,7 @@ impl Fs {
let num_queues = NUM_QUEUE_OFFSET + req_num_queues;
// Connect to the vhost-user socket.
let mut vhost_user_fs = connect_vhost_user(false, &path, num_queues as u64, false)?;
let mut vhost_user_fs = connect_vhost_user(false, path, num_queues as u64, false)?;
// Filling device and vring features VMM supports.
let avail_features = DEFAULT_VIRTIO_FEATURES;

View File

@@ -234,7 +234,7 @@ impl VsockChannel for VsockMuxer {
// connection requests.
if pkt.op() == uapi::VSOCK_OP_REQUEST {
// Oh, this is a connection request!
self.handle_peer_request_pkt(&pkt);
self.handle_peer_request_pkt(pkt);
} else {
// Send back an RST, to let the drive know we weren't expecting this packet.
self.enq_rst(pkt.dst_port(), pkt.src_port());