Created
May 17, 2015 08:22
-
-
Save debloper/556b32b4769682b1a7de to your computer and use it in GitHub Desktop.
A simple switch-case/match with string output reference implementation on Rust
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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