Zipping iterator with a range when `enumerate()` would doRS-W1012
Zipping an iterator with a range from 0 to the iterator's length is better
expressed with .enumerate()
.
Remove the call to .zip()
and replace with a call to .enumerate()
. This is
easier to read and the intent is obvious.
Bad practice
x.iter().zip(0..x.len());
Recommended
x.iter().enumerate();