Skip to content

Instantly share code, notes, and snippets.

@BrantRoom3327
Last active June 20, 2018 19:33
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 BrantRoom3327/b11f543ee140727cb3d1c08b843ac117 to your computer and use it in GitHub Desktop.
Save BrantRoom3327/b11f543ee140727cb3d1c08b843ac117 to your computer and use it in GitHub Desktop.
Optional of T {
None, //There is nothing here. Empty. Nada.
Some(T) //We have an item T
}
//Examples
let myOption = Some(5); // Some(int32)
let myOption = Some("Rodents of unusual size. I don't believe they exist"); // Some(String)
let myOption = None; // We got nothing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment