From 7d5d9bdcf4b2e9ae6903e50f91740ef29cd51705 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 25 Mar 2021 17:01:21 +0000 Subject: [PATCH] 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 --- vhost_user_block/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vhost_user_block/src/lib.rs b/vhost_user_block/src/lib.rs index 5fa84fe30..7cbd06c32 100644 --- a/vhost_user_block/src/lib.rs +++ b/vhost_user_block/src/lib.rs @@ -393,7 +393,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(()) }