Closed
Description
for
loops implicitly call .into_iter()
on that which is being iterated over, but if someone didn't know this, they might have written .into_iter()
themselves (this is not merely a hypothetical scenario), which is surely bad style.
Example of code that should get a warning (but does not as of Clippy v. 0.0.79):
fn main() {
let my_vec = vec![1, 2, 3, 4];
for i in my_vec.into_iter() {
println!("{}", i);
}
}
(could be just for i in my_vec {
)
I'm guessing the implementation would probably be pretty similar to that of the existing explicit_iter_loop
lint?