Advertisement
cwchen

[Rust] Iterate an array with an iterator.

Aug 22nd, 2017
731
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. fn main() {
  2. let array = ["eins", "zwei", "drei", "vier", "fünf"];
  3.  
  4. for element in array.iter() {
  5. println!("{}", element);
  6. }
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement