Skip to content

Instantly share code, notes, and snippets.

@codatory
Created August 3, 2013 10:10
Show Gist options
  • Save codatory/6145966 to your computer and use it in GitHub Desktop.
Save codatory/6145966 to your computer and use it in GitHub Desktop.
CodeStation:learnrust codatory$ rust run iteration.rs
iteration.rs:5:10: 5:11 error: expected `;` or `}` after expression but found `x`
iteration.rs:5 foreach x in xs.iter() {
fn main() {
let xs = [2, 3, 5, 7, 11, 13, 17];
// print out all the elements in the vector
foreach x in xs.iter() {
println(x.to_str())
}
}
@codatory
Copy link
Author

codatory commented Aug 3, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment