Skip to content

Instantly share code, notes, and snippets.

@Pusungwi
Last active August 29, 2015 14:21
Show Gist options
  • Save Pusungwi/4979090ef269e94490bd to your computer and use it in GitHub Desktop.
Save Pusungwi/4979090ef269e94490bd to your computer and use it in GitHub Desktop.
Take ownership example
fn take(v : Vec<i32>) {
//take ownership
}
fn main() {
let v = vec![1, 2, 3];
take(v);
println!("v[0] is {}", v[0]); // <- ERROR
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment