Created
April 5, 2016 01:29
-
-
Save kscz/d477ff7f5df223d900878093c71eaefb 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 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