mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
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
@ -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…
Reference in New Issue
Block a user