Rename to Options
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Peter · committed by David Peter · parent 39a85b8 · Browse files · 3 files·+10 added−10 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+10 added−10 removed
- other:+10 added−10 removed
Provenance
- Commit
b54b2f8- Tree
4380f71- Author
David Peter <mail@david-peter.de>- Committer
David Peter <sharkdp@users.noreply.github.com>- Parent
39a85b8
3 files changed+10 added−10 removed
modified:src/benchmark.rs+2 added-2 removed
6 unmodified lines7 use crate::benchmark_result::BenchmarkResult;8 use crate::command::Command;9 use crate::format::{format_duration, format_duration_unit};10 use crate::min_max::{max, min};11-use crate::options::{CmdFailureAction, HyperfineOptions, OutputStyleOption, Shell};11+use crate::options::{CmdFailureAction, Options, OutputStyleOption, Shell};12 use crate::outlier_detection::{modified_zscores, OUTLIER_THRESHOLD};13 use crate::progress_bar::get_progress_bar;14 use crate::shell::execute_and_time;15 use crate::timer::wallclocktimer::WallClockTimer;223 unmodified lines239 pub fn run_benchmark(240 num: usize,241 cmd: &Command<'_>,242 shell_spawning_time: TimingResult,243- options: &HyperfineOptions,243+ options: &Options,244 ) -> Result<BenchmarkResult> {245 let command_name = cmd.get_name();246 if options.output_style != OutputStyleOption::Disabled {247 println!(269 unmodified linesmodified:src/main.rs+3 added-3 removed
28 unmodified lines29 use benchmark_result::BenchmarkResult;30 use command::Command;31 use error::OptionsError;32 use export::{ExportManager, ExportType};33-use options::{HyperfineOptions, OutputStyleOption};33+use options::{Options, OutputStyleOption};34 use parameter_range::get_parameterized_commands;35 use tokenize::tokenize;36 use types::ParameterValue;37 38 unmodified lines76 }77 78 fn run_benchmarks_and_print_comparison(79 commands: &[Command<'_>],80- options: &HyperfineOptions,80+ options: &Options,81 export_manager: &ExportManager,82 ) -> Result<()> {83 let shell_spawning_time =84 mean_shell_spawning_time(&options.shell, options.output_style, options.show_output)?;30 unmodified lines115 #[cfg(windows)]116 colored::control::set_virtual_terminal(true).unwrap();117 118 let matches = get_arg_matches(env::args_os());119- let options = HyperfineOptions::from_cli_arguments(&matches)?;119+ let options = Options::from_cli_arguments(&matches)?;120 let commands = build_commands(&matches)?;121 let export_manager = build_export_manager(&matches)?;122 123 run_benchmarks_and_print_comparison(&commands, &options, &export_manager)226 unmodified linesmodified:src/options.rs+5 added-5 removed
102 unmodified lines103 }104 }105 106 /// A set of options for hyperfine107-pub struct HyperfineOptions {107+pub struct Options {108 /// Number of warmup runs109 pub warmup_count: u64,110 111 /// Number of benchmark runs31 unmodified lines143 /// benchmark outputs.144 pub names: Option<Vec<String>>,145 }146 147-impl Default for HyperfineOptions {148- fn default() -> HyperfineOptions {149- HyperfineOptions {147+impl Default for Options {148+ fn default() -> Options {149+ Options {150 names: None,151 warmup_count: 0,152 runs: Runs::default(),153 min_time_sec: 3.0,8 unmodified lines162 }163 }164 }165 166-impl HyperfineOptions {166+impl Options {167 pub fn from_cli_arguments<'a>(matches: &ArgMatches) -> Result<Self, OptionsError<'a>> {168 let mut options = Self::default();169 let param_to_u64 = |param| {170 matches136 unmodified lines