Created
August 3, 2013 10:10
-
-
Save codatory/6145966 to your computer and use it in GitHub Desktop.
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
| 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() { |
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 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()) | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Direct from http://static.rust-lang.org/doc/tutorial-container.html