Option
type RS-E1004Calling .next()
on an iterator produces an Option<T>
, which also implements
IntoIterator
. This is probably a mistake, consider revisiting this for
loop.
for x in [1, 2, 3].iter().next() {
// ...
}
// if the intention was to start from the second element,
// consider using `.skip(1)`
for x in [1, 2, 3].iter().skip(1) {
// ...
}
// or
let mut my_iterator = [1, 2, 3].iter();
let _ = my_iterator.next();
for x in my_iterator {
// ...
}