Closed
Description
fn main() {
(0..10).step_by(2).rev().next();
}
produces the following error:
error: type `core::iter::Rev<core::iter::StepBy<_, core::ops::Range<_>>>` does not implement any method in scope named `next`
According to @eddyb, IteratorExt::rev
should be bounded by DoubleEndedIterator
to prevent this.
EDIT: Updated the example to show the correct error.
Metadata
Metadata
Assignees
Labels
No labels