Advertisement
cwchen

[Rust] Iterate a vector with an iterator.

Aug 22nd, 2017
716
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.12 KB | None | 0 0
  1. fn main() {
  2.     let vec = vec![1, 2, 3];
  3.  
  4.     for element in vec.iter() {
  5.         println!("{}", element);
  6.     }
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement