mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 08:50:19 +00:00
Rename to Options
This commit is contained in:
1 parent
39a85b88cf
commit
b54b2f81f4
3 files changed
+10
-10
No files matched your search
+2
-2
@@ -8,7 +8,7 @@ use crate::benchmark_result::BenchmarkResult;
|
||||
use crate::command::Command;
|
||||
use crate::format::{format_duration, format_duration_unit};
|
||||
use crate::min_max::{max, min};
|
||||
use crate::options::{CmdFailureAction, HyperfineOptions, OutputStyleOption, Shell};
|
||||
use crate::options::{CmdFailureAction, Options, OutputStyleOption, Shell};
|
||||
use crate::outlier_detection::{modified_zscores, OUTLIER_THRESHOLD};
|
||||
use crate::progress_bar::get_progress_bar;
|
||||
use crate::shell::execute_and_time;
|
||||
@@ -240,7 +240,7 @@ pub fn run_benchmark(
|
||||
num: usize,
|
||||
cmd: &Command<'_>,
|
||||
shell_spawning_time: TimingResult,
|
||||
options: &HyperfineOptions,
|
||||
options: &Options,
|
||||
) -> Result<BenchmarkResult> {
|
||||
let command_name = cmd.get_name();
|
||||
if options.output_style != OutputStyleOption::Disabled {
|
||||
|
||||
+3
-3
@@ -30,7 +30,7 @@ use benchmark_result::BenchmarkResult;
|
||||
use command::Command;
|
||||
use error::OptionsError;
|
||||
use export::{ExportManager, ExportType};
|
||||
use options::{HyperfineOptions, OutputStyleOption};
|
||||
use options::{Options, OutputStyleOption};
|
||||
use parameter_range::get_parameterized_commands;
|
||||
use tokenize::tokenize;
|
||||
use types::ParameterValue;
|
||||
@@ -77,7 +77,7 @@ pub fn write_benchmark_comparison(results: &[BenchmarkResult]) {
|
||||
|
||||
fn run_benchmarks_and_print_comparison(
|
||||
commands: &[Command<'_>],
|
||||
options: &HyperfineOptions,
|
||||
options: &Options,
|
||||
export_manager: &ExportManager,
|
||||
) -> Result<()> {
|
||||
let shell_spawning_time =
|
||||
@@ -116,7 +116,7 @@ fn run() -> Result<()> {
|
||||
colored::control::set_virtual_terminal(true).unwrap();
|
||||
|
||||
let matches = get_arg_matches(env::args_os());
|
||||
let options = HyperfineOptions::from_cli_arguments(&matches)?;
|
||||
let options = Options::from_cli_arguments(&matches)?;
|
||||
let commands = build_commands(&matches)?;
|
||||
let export_manager = build_export_manager(&matches)?;
|
||||
|
||||
|
||||
+5
-5
@@ -104,7 +104,7 @@ impl Default for Runs {
|
||||
}
|
||||
|
||||
/// A set of options for hyperfine
|
||||
pub struct HyperfineOptions {
|
||||
pub struct Options {
|
||||
/// Number of warmup runs
|
||||
pub warmup_count: u64,
|
||||
|
||||
@@ -144,9 +144,9 @@ pub struct HyperfineOptions {
|
||||
pub names: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
impl Default for HyperfineOptions {
|
||||
fn default() -> HyperfineOptions {
|
||||
HyperfineOptions {
|
||||
impl Default for Options {
|
||||
fn default() -> Options {
|
||||
Options {
|
||||
names: None,
|
||||
warmup_count: 0,
|
||||
runs: Runs::default(),
|
||||
@@ -163,7 +163,7 @@ impl Default for HyperfineOptions {
|
||||
}
|
||||
}
|
||||
|
||||
impl HyperfineOptions {
|
||||
impl Options {
|
||||
pub fn from_cli_arguments<'a>(matches: &ArgMatches) -> Result<Self, OptionsError<'a>> {
|
||||
let mut options = Self::default();
|
||||
let param_to_u64 = |param| {
|
||||
|
||||
Reference in new issue
Block a user