Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.