Skip to content

Instantly share code, notes, and snippets.

@ryanmr
Created January 9, 2016 01:57
Show Gist options
  • Save ryanmr/1429d1e0b12dae1d4ed0 to your computer and use it in GitHub Desktop.
Save ryanmr/1429d1e0b12dae1d4ed0 to your computer and use it in GitHub Desktop.
let args: Vec<String> = env::args().collect();
let threads:usize;
let multiplier:f64;
let _ = match args.len() {
3 => {
threads = match args[1].trim().parse() {
Ok(x) => x,
Err(_) => 1
};
multiplier = match args[2].trim().parse() {
Ok(x) => x,
Err(_) => 1.00
};
},
2 => {
threads = match args[1].trim().parse() {
Ok(x) => x,
Err(_) => 1
};
multiplier = 1.00;
},
_ => {
threads = 1;
multiplier = 1.00;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment