From 737403df35c096e741150c65ef1e007a70869ccf Mon Sep 17 00:00:00 2001 From: Piyush Rungta Date: Fri, 30 Aug 2019 22:07:14 +0530 Subject: [PATCH] Run cargo fmt --- src/main.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 998a8cb..6dd4b1b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,10 +28,7 @@ pub fn error(message: &str) -> ! { } /// Runs the benchmark for the given commands -fn run( - commands: &[Command<'_>], - options: &HyperfineOptions, -) -> io::Result> { +fn run(commands: &[Command<'_>], options: &HyperfineOptions) -> io::Result> { let shell_spawning_time = mean_shell_spawning_time(&options.shell, options.output_style, options.show_output)?; @@ -47,7 +44,8 @@ fn run( /// A function to read the `--parameter-scan` arguments fn parse_parameter_scan_args<'a>( - mut vals: clap::Values<'a>, step_size: &str + mut vals: clap::Values<'a>, + step_size: &str, ) -> Result<(&'a str, StepBy>), ParameterScanError> { let param_name = vals.next().unwrap(); let param_min: i32 = vals.next().unwrap().parse()?; @@ -102,10 +100,13 @@ fn main() { /// Build the HyperfineOptions that correspond to the given ArgMatches fn build_hyperfine_options(matches: &ArgMatches<'_>) -> Result { let mut options = HyperfineOptions::default(); - let param_to_u64 = |param| matches.value_of(param).and_then(|n| u64::from_str_radix(n, 10).ok()); + let param_to_u64 = |param| { + matches + .value_of(param) + .and_then(|n| u64::from_str_radix(n, 10).ok()) + }; - options.warmup_count = param_to_u64("warmup") - .unwrap_or(options.warmup_count); + options.warmup_count = param_to_u64("warmup").unwrap_or(options.warmup_count); let mut min_runs = param_to_u64("min-runs"); let mut max_runs = param_to_u64("max-runs");