From 26706b37902475fb31844c44579d4a4c7283ca66 Mon Sep 17 00:00:00 2001 From: Lukas Kalbertodt Date: Wed, 30 Oct 2019 15:32:11 +0100 Subject: [PATCH] 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. --- src/ipv6.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipv6.rs b/src/ipv6.rs index e5667bb..d382161 100644 --- a/src/ipv6.rs +++ b/src/ipv6.rs @@ -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 { 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;