From 0950c822944fde157f2bd9b9807be66d876f6fe5 Mon Sep 17 00:00:00 2001 From: Mathias Svensson Date: Wed, 30 Oct 2019 22:18:54 +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. --- typed-html/src/types/spacedlist.rs | 2 +- typed-html/src/types/spacedset.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/typed-html/src/types/spacedlist.rs b/typed-html/src/types/spacedlist.rs index 464dee4..8859c44 100644 --- a/typed-html/src/types/spacedlist.rs +++ b/typed-html/src/types/spacedlist.rs @@ -245,7 +245,7 @@ macro_rules! spacedlist_from_array { { type Error = ::Err; fn try_from(s: [&str; $num]) -> Result { - s.into_iter().map(|s| FromStr::from_str(*s)).collect() + s.iter().map(|s| FromStr::from_str(*s)).collect() } } }; diff --git a/typed-html/src/types/spacedset.rs b/typed-html/src/types/spacedset.rs index b497d8e..1b8eb26 100644 --- a/typed-html/src/types/spacedset.rs +++ b/typed-html/src/types/spacedset.rs @@ -272,7 +272,7 @@ macro_rules! spacedset_from_array { { type Error = ::Err; fn try_from(s: [&str; $num]) -> Result { - s.into_iter().map(|s| FromStr::from_str(*s)).collect() + s.iter().map(|s| FromStr::from_str(*s)).collect() } } };