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:
Aaron Hill 2019-10-30 15:57:35 -04:00
parent 79aebd9a17
commit 58e2bab9aa
No known key found for this signature in database
GPG key ID: B4087E510E98B164
2 changed files with 2 additions and 2 deletions

View file

@ -569,7 +569,7 @@ impl Context {
value = rem;
}
}
Ok(list.into_iter().zip(out.into_iter()).map(|(name, value)| {
Ok(list.iter().zip(out.into_iter()).map(|(name, value)| {
let pretty = Number {
value: value,
unit: Number::one_unit(Dim::new(name)).unit

View file

@ -38,7 +38,7 @@ pub fn fast_decompose(value: &Number, quantities: &BTreeMap<Unit, String>) -> Un
value: Num::one(),
unit: unit.clone(),
};
for &i in [-1, 1, 2].into_iter() {
for &i in [-1, 1, 2].iter() {
let res = (value / &num.powi(i)).unwrap();
let score = res.complexity_score();
let better = best.as_ref().map(|&(_, _, _, current)| score < current).unwrap_or(true);