Skip to content

Instantly share code, notes, and snippets.

@kracekumar
Created November 13, 2016 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kracekumar/df1d975acfae9bc2a40ba3732b8b3ccf to your computer and use it in GitHub Desktop.
Save kracekumar/df1d975acfae9bc2a40ba3732b8b3ccf to your computer and use it in GitHub Desktop.
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