Skip to content

Instantly share code, notes, and snippets.

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