vhost_user_block: Address Rust 1.51.0 clippy issue (redundant_slicing)

error: redundant slicing of the whole range
   --> vhost_user_block/src/lib.rs:396:31
    |
396 |         right.copy_from_slice(&data[..]);
    |                               ^^^^^^^^^ help: use the original slice instead: `data`
    |
    = note: `-D clippy::redundant-slicing` implied by `-D warnings`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_slicing

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2021-03-25 17:01:21 +00:00
parent 85ad72490f
commit 7d5d9bdcf4

View File

@ -393,7 +393,7 @@ impl VhostUserBackend for VhostUserBlkBackend {
return Err(io::Error::from_raw_os_error(libc::EINVAL)); return Err(io::Error::from_raw_os_error(libc::EINVAL));
} }
let (_, right) = config_slice.split_at_mut(offset as usize); let (_, right) = config_slice.split_at_mut(offset as usize);
right.copy_from_slice(&data[..]); right.copy_from_slice(&data);
self.update_writeback(); self.update_writeback();
Ok(()) Ok(())
} }