Created
April 5, 2016 01:25
-
-
Save kscz/31c77c70819b103e3ebe4f285bf592ba 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::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