Skip to content

Instantly share code, notes, and snippets.

@killercup
Created August 4, 2016 13:30
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 killercup/68645e903a2f903cf43d3070d562a809 to your computer and use it in GitHub Desktop.
Save killercup/68645e903a2f903cf43d3070d562a809 to your computer and use it in GitHub Desktop.
#![allow(unused_variables)]
// Easy for API author, easy to read documentation
fn foo(lorem: &str, ipsum: Option<i32>, dolor: Option<i32>, sit: Option<i32>) {
println!("{}", lorem);
}
fn main() {
foo("bar", None, None, None); // That looks weird
foo("bar", Some(42), None, None); // Okay
foo("bar", Some(42), Some(1337), Some(-1)); // Halp! Too… much… Some…!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment