Skip to content
Myr

Run cargo fmt

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Piyush Rungta · committed by David Peter · parent c856a5b · Browse files · 1 file+9 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+9 added−8 removed

  • other:+9 added−8 removed

1 file+9 added−8 removed

modified:src/main.rs+9 added-8 removed
26 unmodified lines
27 std::process::exit(1);28}2930/// Runs the benchmark for the given commands31fn run(32 commands: &[Command<'_>],33 options: &HyperfineOptions,34) -> io::Result<Vec<BenchmarkResult>> {31fn run(commands: &[Command<'_>], options: &HyperfineOptions) -> io::Result<Vec<BenchmarkResult>> {32 let shell_spawning_time =33 mean_shell_spawning_time(&options.shell, options.output_style, options.show_output)?;3435 let mut timing_results = vec![];
7 unmodified lines
43}4445/// A function to read the `--parameter-scan` arguments46fn parse_parameter_scan_args<'a>(50 mut vals: clap::Values<'a>, step_size: &str47 mut vals: clap::Values<'a>,48 step_size: &str,49) -> Result<(&'a str, StepBy<Range<i32>>), ParameterScanError> {50 let param_name = vals.next().unwrap();51 let param_min: i32 = vals.next().unwrap().parse()?;52 let param_max: i32 = vals.next().unwrap().parse()?;
46 unmodified lines
99100/// Build the HyperfineOptions that correspond to the given ArgMatches101fn build_hyperfine_options(matches: &ArgMatches<'_>) -> Result<HyperfineOptions, OptionsError> {102 let mut options = HyperfineOptions::default();105 let param_to_u64 = |param| matches.value_of(param).and_then(|n| u64::from_str_radix(n, 10).ok());103 let param_to_u64 = |param| {104 matches105 .value_of(param)106 .and_then(|n| u64::from_str_radix(n, 10).ok())107 };108107 options.warmup_count = param_to_u64("warmup")108 .unwrap_or(options.warmup_count);109 options.warmup_count = param_to_u64("warmup").unwrap_or(options.warmup_count);110111 let mut min_runs = param_to_u64("min-runs");112 let mut max_runs = param_to_u64("max-runs");113
123 unmodified lines