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 <robert.bradford@intel.com>
This commit is contained in:
parent
bfbd75b2cf
commit
eb18ea61f4
1 changed files with 1 additions and 1 deletions
|
|
@ -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 }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue