mirror of
https://github.com/sharkdp/hyperfine.git
synced 2024-11-30 11:53:11 +03:00
Use 'if' instead of 'match'
This commit is contained in:
parent
ea2d622cc1
commit
92e59c37c1
@ -235,15 +235,14 @@ pub fn run_benchmark(
|
||||
|
||||
// Run init command
|
||||
let prepare_cmd = options.preparation_command.as_ref().map(|values| {
|
||||
let corresponding_prepare_cmd = match values.len() {
|
||||
1 => &values[0],
|
||||
_ => &values[num],
|
||||
let preparation_command = if values.len() == 1 {
|
||||
&values[0]
|
||||
} else {
|
||||
&values[num]
|
||||
};
|
||||
match cmd.get_parameter() {
|
||||
Some((param, value)) => {
|
||||
Command::new_parametrized(corresponding_prepare_cmd, param, value)
|
||||
}
|
||||
None => Command::new(corresponding_prepare_cmd),
|
||||
Some((param, value)) => Command::new_parametrized(preparation_command, param, value),
|
||||
None => Command::new(preparation_command),
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user