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
|
// Run init command
|
||||||
let prepare_cmd = options.preparation_command.as_ref().map(|values| {
|
let prepare_cmd = options.preparation_command.as_ref().map(|values| {
|
||||||
let corresponding_prepare_cmd = match values.len() {
|
let preparation_command = if values.len() == 1 {
|
||||||
1 => &values[0],
|
&values[0]
|
||||||
_ => &values[num],
|
} else {
|
||||||
|
&values[num]
|
||||||
};
|
};
|
||||||
match cmd.get_parameter() {
|
match cmd.get_parameter() {
|
||||||
Some((param, value)) => {
|
Some((param, value)) => Command::new_parametrized(preparation_command, param, value),
|
||||||
Command::new_parametrized(corresponding_prepare_cmd, param, value)
|
None => Command::new(preparation_command),
|
||||||
}
|
|
||||||
None => Command::new(corresponding_prepare_cmd),
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user