Skip to content

Instantly share code, notes, and snippets.

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