Skip to content

Instantly share code, notes, and snippets.

@kscz
Created April 5, 2016 01:29
Show Gist options
  • Save kscz/d477ff7f5df223d900878093c71eaefb to your computer and use it in GitHub Desktop.
Save kscz/d477ff7f5df223d900878093c71eaefb to your computer and use it in GitHub Desktop.
fn main() {
let mut x = String::new();
foo(x);
println!("{} to the other side.", x); // ERROR: we gave away x!
}
fn foo(mut bar: String) -> () {
bar.push_str("Break on through");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment