Created
April 5, 2016 01:31
-
-
Save kscz/bf9025a100d336c6affcea58a5f15991 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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