Use proper match condition for duration (#2182)

This commit is contained in:
Sathish 2018-12-14 21:18:41 -08:00 committed by GitHub
parent 5bf9a20d42
commit 3f835f8ee3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -147,8 +147,11 @@ pub fn extract_args<'a>(matches: &ArgMatches<'a>) -> Config {
args.num_nodes = n.to_string().parse().expect("can't parse num-nodes");
}
if let Some(s) = matches.value_of("s") {
args.duration = Duration::new(s.to_string().parse().expect("can't parse duration"), 0);
if let Some(duration) = matches.value_of("duration") {
args.duration = Duration::new(
duration.to_string().parse().expect("can't parse duration"),
0,
);
}
if let Some(s) = matches.value_of("tx_count") {