From eb18ea61f499f0ec5eb18326d7a96c22fd4eabf2 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 25 Mar 2021 17:01:21 +0000 Subject: [PATCH] net_util: Address Rust 1.51.0 clippy issue (redundant_slicing) error: redundant slicing of the whole range --> net_util/src/mac.rs:60:35 | 60 | bytes[..].copy_from_slice(&src[..]); | ^^^^^^^^ help: use the original slice instead: `src` | = 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 --- net_util/src/mac.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net_util/src/mac.rs b/net_util/src/mac.rs index 548829a48..ff01e49a9 100644 --- a/net_util/src/mac.rs +++ b/net_util/src/mac.rs @@ -57,7 +57,7 @@ impl MacAddr { // TODO: using something like std::mem::uninitialized could avoid the extra initialization, // if this ever becomes a performance bottleneck. let mut bytes = [0u8; MAC_ADDR_LEN]; - bytes[..].copy_from_slice(&src[..]); + bytes[..].copy_from_slice(&src); MacAddr { bytes } }