Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created October 15, 2018 10:45
Show Gist options
  • Save rust-play/5f1900ce76571f3ed36d4b24583ad02a to your computer and use it in GitHub Desktop.
Save rust-play/5f1900ce76571f3ed36d4b24583ad02a to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
enum Result {
PeopleNotice,
Others,
}
fn fuck_the_users(n: i32) -> Result {
if n > 2 {
Result::PeopleNotice
}else {
Result::Others
}
}
fn main() {
let mut hardness = 0;
loop {
let result = fuck_the_users(hardness);
match result {
PeopleNotice => {println!("Sorry"); break;},
_ => {hardness += 1},
}
if hardness > 2 { break; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment