Advertisement
cwchen

[Rust] Iterating an array with a slice.

Aug 22nd, 2017
730
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.18 KB | None | 0 0
  1. fn main() {
  2.     let array = ["eins", "zwei", "drei", "vier", "fünf"];
  3.  
  4.     // It works when the array size <= 32
  5.     for element in &array {
  6.        println!("{}", element);
  7.     }
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement