Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created April 6, 2018 12:24
Show Gist options
  • Save rust-play/30996e6970bb7b3eb0f1f839e33a85e0 to your computer and use it in GitHub Desktop.
Save rust-play/30996e6970bb7b3eb0f1f839e33a85e0 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
fn main() {
give();
}
fn give(){
let mut vec = Vec::new();
vec.push(1);
vec.push(2);
take(vec);
vec.push(3);
}
fn take(vec: Vec<i32>){
println!("{:?}", vec);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment