Skip to content

Commit 0950c82

Browse files
TethysSvenssonbodil
authored andcommitted
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.
1 parent b9fc11b commit 0950c82

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

typed-html/src/types/spacedlist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ macro_rules! spacedlist_from_array {
245245
{
246246
type Error = <A as FromStr>::Err;
247247
fn try_from(s: [&str; $num]) -> Result<Self, Self::Error> {
248-
s.into_iter().map(|s| FromStr::from_str(*s)).collect()
248+
s.iter().map(|s| FromStr::from_str(*s)).collect()
249249
}
250250
}
251251
};

typed-html/src/types/spacedset.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ macro_rules! spacedset_from_array {
272272
{
273273
type Error = <A as FromStr>::Err;
274274
fn try_from(s: [&str; $num]) -> Result<Self, Self::Error> {
275-
s.into_iter().map(|s| FromStr::from_str(*s)).collect()
275+
s.iter().map(|s| FromStr::from_str(*s)).collect()
276276
}
277277
}
278278
};

0 commit comments

Comments
 (0)