Last active
January 8, 2017 10:45
-
-
Save dumindu/18c6794b4ff53c375615 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
let mut v = vec![1, 2, 3, 4, 5]; | |
for i in &v { | |
println!("A reference to {}", i); | |
} | |
for i in &mut v { | |
println!("A mutable reference to {}", i); | |
} | |
for i in v { | |
println!("Take ownership of the vector and its element {}", i); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment