fn main() {
for i in (0..3).rev().step_by(1) {
print!("{}", i);
}
}
// 打印结果:210
Trait std::iter::Iterator
- fn rev(self) -> Rev< Self > where Self: Sized + DoubleEndedIterator
- fn step_by(self, step: usize) -> StepBy< Self > where Self: Sized