gotcha
| for i in std::iter::range_step(2, -1, -1) { | |
| println!("{}", i); | |
| } | |
| // prints 2, 1, 0 | |
| let x = ["a", "b", "c"]; | |
| for i in std::iter::range_step(2, -1, -1) { | |
| println!("{}", x[i]); | |
| } | |
| // prints "c" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment