mirror of
https://github.com/achanda/ipnetwork.git
synced 2025-06-16 00:48:10 +00:00
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:
@ -247,7 +247,7 @@ impl fmt::Display for Ipv6Network {
|
||||
/// If the mask is invalid this will return an `IpNetworkError::InvalidPrefix`.
|
||||
pub fn ipv6_mask_to_prefix(mask: Ipv6Addr) -> Result<u8, IpNetworkError> {
|
||||
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
|
||||
let mut prefix = 0;
|
||||
|
Reference in New Issue
Block a user