Created
November 24, 2016 10:39
-
-
Save anonymous/0a9c8508b557cdbf44dbb1c21d66eef2 to your computer and use it in GitHub Desktop.
Shared via Rust Playground
This file contains 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 plus_5<T: Into<Option<i32>>>(t: T) { | |
let x = t.into(); | |
println!("{:?}", x.unwrap() + 5); | |
} | |
fn main() { | |
plus_5(Some(10)); | |
// plus_5(10); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment