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:
Mathias Svensson 2019-10-30 22:18:54 +01:00 committed by Bodil Stokke
parent b9fc11b18e
commit 0950c82294
2 changed files with 2 additions and 2 deletions

View File

@ -245,7 +245,7 @@ macro_rules! spacedlist_from_array {
{
type Error = <A as FromStr>::Err;
fn try_from(s: [&str; $num]) -> Result<Self, Self::Error> {
s.into_iter().map(|s| FromStr::from_str(*s)).collect()
s.iter().map(|s| FromStr::from_str(*s)).collect()
}
}
};

View File

@ -272,7 +272,7 @@ macro_rules! spacedset_from_array {
{
type Error = <A as FromStr>::Err;
fn try_from(s: [&str; $num]) -> Result<Self, Self::Error> {
s.into_iter().map(|s| FromStr::from_str(*s)).collect()
s.iter().map(|s| FromStr::from_str(*s)).collect()
}
}
};