Last active
December 5, 2016 17:52
-
-
Save kenzan100/e6359e2c8ab9d1ebb1a35a27364a51ac 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
fn use_x() { | |
let v = make_v(); | |
print_v(&v); | |
print_v(&v); | |
} | |
fn print_v(v: &Vec<i32>) { | |
println!("{}", v[0]); | |
} | |
fn make_v() -> Vec<i32> { | |
let v = vec![2, 4]; | |
v | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment