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