Skip to content

Instantly share code, notes, and snippets.

@why-jay
Created December 8, 2014 06:32
Show Gist options
  • Save why-jay/443650e22cda9c3e9535 to your computer and use it in GitHub Desktop.
Save why-jay/443650e22cda9c3e9535 to your computer and use it in GitHub Desktop.
Demo of Rust's Option<T> Type
fn foo(x: Option<int>) {
match x {
Some(val) -> println!("{}", val),
None -> println!("Sad")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment