Created
October 8, 2015 17:51
-
-
Save anonymous/0783663b3378246ff738 to your computer and use it in GitHub Desktop.
Shared via Rust Playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let values = vec![1, 2, 3]; | |
for x in values { | |
println!("{}", x); | |
} | |
// Rough translation of the iteration without a `for` iterator. | |
let values = vec![1, 2, 3]; | |
let mut it = values.into_iter(); | |
loop { | |
match it.next() { | |
Some(x) => println!("{}", x), | |
None => break, | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment