Skip to content

Instantly share code, notes, and snippets.

@debloper
Created May 17, 2015 08:22
Show Gist options
  • Save debloper/556b32b4769682b1a7de to your computer and use it in GitHub Desktop.
Save debloper/556b32b4769682b1a7de to your computer and use it in GitHub Desktop.
A simple switch-case/match with string output reference implementation on Rust
use std::os;
fn main() {
let argv = &os::args();
match argv[1] {
~"biteMe" => println("\n\tBite my _Rusty_ metal ass!\n"),
~"killYa" => println("\n\tKILL ALL HUMANS!\n"),
~"letsGo" => println("\n\tLet's GO ALREADYYY...\n"),
_ => println("\n\tOh. Your. God.\n")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment