solicit icon indicating copy to clipboard operation
solicit copied to clipboard

Use slice::iter

Open tesuji opened this issue 4 years ago • 3 comments

This helps https://github.com/rust-lang/rust/pull/65819

tesuji avatar Oct 30 '19 08:10 tesuji

Ping

tesuji avatar Jun 14 '20 12:06 tesuji

Here's an explanation of the purpose of this PR:

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.

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


@lzutao You may want to squash your commits and use the following commit message

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.

pitaj avatar Aug 28 '20 02:08 pitaj

I will do if the repo owner show an interest to this PR.

tesuji avatar Aug 28 '20 02:08 tesuji