Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
fn return_none() -> Option<bool>{
None
}
fn main(){
println!("{:?}", return_none().unwrap());
}
// Output
()/home/user/code/snippets/ $ ./rust_options
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', ../src/libcore/option.rs:323
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.