Created
August 23, 2014 02:14
-
-
Save piisalie/80c67b76c0f08768e517 to your computer and use it in GitHub Desktop.
This file contains 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 increment_mut(p: &mut Vec<int>) { | |
for num in p.mut_iter() { | |
*num = *num + 1 | |
} | |
} | |
fn main() { | |
let mut p = vec![1i, 2, 3]; | |
increment_mut(&mut p); | |
for &x in p.iter() { | |
print!("{:d} ", x); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment