Created
April 5, 2016 03:42
-
-
Save kscz/285e5c5b29214bc5b07a8b9d9abd4b30 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); // Give away an immutable reference of x to foo | |
println!("{} from the other side.", x); | |
} | |
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