Skip to content

Commit

Permalink
Merge #378
Browse files Browse the repository at this point in the history
378: Use `slice::iter` instead of `into_iter` to avoid future breakage r=jswrenn a=LukasKalbertodt

`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.

A crater run showed that your crate is affected by a potential future change. See rust-lang/rust#65819 for more information.

Co-authored-by: Lukas Kalbertodt <lukas.kalbertodt@gmail.com>
  • Loading branch information
bors[bot] and LukasKalbertodt committed Oct 30, 2019
2 parents 7554521 + cb3c993 commit 09403b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions benches/bench1.rs
Expand Up @@ -688,7 +688,7 @@ fn multi_cartesian_product_iterator(b: &mut test::Bencher)

b.iter(|| {
let mut sum = 0;
for x in xs.into_iter().multi_cartesian_product() {
for x in xs.iter().multi_cartesian_product() {
sum += x[0];
sum += x[1];
sum += x[2];
Expand All @@ -704,7 +704,7 @@ fn multi_cartesian_product_fold(b: &mut test::Bencher)

b.iter(|| {
let mut sum = 0;
xs.into_iter().multi_cartesian_product().fold((), |(), x| {
xs.iter().multi_cartesian_product().fold((), |(), x| {
sum += x[0];
sum += x[1];
sum += x[2];
Expand Down

0 comments on commit 09403b3

Please sign in to comment.