Created
April 5, 2016 01:28
-
-
Save kscz/48c6f05deedb39c0932ef2f3af6a5085 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); | |
} | |
fn foo(bar: &String) -> () { | |
bar.push_str("Break on through"); // ERROR: x is immutable! | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment