Use slice::iter instead of into_iter to avoid future breakage

`an_array.into_iter()` currently just works because of the autoref
feature, which then calls `<[T] as IntoIterator>::into_iter`. But
in the future, arrays will implement `IntoIterator`, too. In order
to avoid problems in the future, the call is replaced by `iter()`
which is shorter and more explicit.
This commit is contained in:
Lukas Kalbertodt
2019-10-30 15:32:11 +01:00
parent 2eed2de227
commit 26706b3790

View File

@ -247,7 +247,7 @@ impl fmt::Display for Ipv6Network {
/// If the mask is invalid this will return an `IpNetworkError::InvalidPrefix`. /// If the mask is invalid this will return an `IpNetworkError::InvalidPrefix`.
pub fn ipv6_mask_to_prefix(mask: Ipv6Addr) -> Result<u8, IpNetworkError> { pub fn ipv6_mask_to_prefix(mask: Ipv6Addr) -> Result<u8, IpNetworkError> {
let mask = mask.segments(); let mask = mask.segments();
let mut mask_iter = mask.into_iter(); let mut mask_iter = mask.iter();
// Count the number of set bits from the start of the address // Count the number of set bits from the start of the address
let mut prefix = 0; let mut prefix = 0;