Created
April 5, 2016 01:39
-
-
Save kscz/a40ba66f8abaa4b2e50a2f00e0613044 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("Mysterious first letter!"); | |
let ref_x = first_letter(&x); | |
println!("{}ystery solved!", ref_x); | |
} | |
fn first_letter<'a>(input: &'a str) -> &'a str { | |
&input[0..1] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment