Created
January 9, 2016 01:57
-
-
Save ryanmr/1429d1e0b12dae1d4ed0 to your computer and use it in GitHub Desktop.
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
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