mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
@@ -154,7 +154,7 @@ impl VhostUserBlkThread {
|
||||
if self.event_idx {
|
||||
let queue = vring.mut_queue();
|
||||
if let Some(used_idx) = queue.add_used(mem, head.index, len) {
|
||||
if queue.needs_notification(&mem, Wrapping(used_idx)) {
|
||||
if queue.needs_notification(mem, Wrapping(used_idx)) {
|
||||
debug!("signalling queue");
|
||||
vring.signal_used_queue().unwrap();
|
||||
} else {
|
||||
@@ -391,7 +391,7 @@ impl VhostUserBackend for VhostUserBlkBackend {
|
||||
return Err(io::Error::from_raw_os_error(libc::EINVAL));
|
||||
}
|
||||
let (_, right) = config_slice.split_at_mut(offset as usize);
|
||||
right.copy_from_slice(&data);
|
||||
right.copy_from_slice(data);
|
||||
self.update_writeback();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user