Created
June 6, 2020 15:46
-
-
Save drguildo/9665720eea127ce8db2646d47d65f1ba to your computer and use it in GitHub Desktop.
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 foo1() { | |
let foo: Option<i32> = Some(1234); | |
println!("{}", foo.unwrap_or(4321)); | |
let bar = foo; | |
} | |
fn foo2() { | |
let foo: Option<String> = Some("1234".to_string()); | |
println!("{}", foo.unwrap_or("4321".to_string())); | |
let bar = foo; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment