Skip to content
Myr

Fix clippy suggestions

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 b38bfc8 · Browse files · 3 files+13 added−13 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+13 added−13 removed

  • other:+13 added−13 removed

3 files+13 added−13 removed

modified:src/export/mod.rs+5 added-5 removed
78 unmodified lines
7980 /// Add an additional exporter to the ExportManager81 pub fn add_exporter(&mut self, export_type: ExportType, filename: &str) -> Result<()> {82 let exporter: Box<dyn Exporter> = match export_type {83 ExportType::Asciidoc => Box::new(AsciidocExporter::default()),84 ExportType::Csv => Box::new(CsvExporter::default()),85 ExportType::Json => Box::new(JsonExporter::default()),86 ExportType::Markdown => Box::new(MarkdownExporter::default()),87 ExportType::Orgmode => Box::new(OrgmodeExporter::default()),83 ExportType::Asciidoc => Box::<AsciidocExporter>::default(),84 ExportType::Csv => Box::<CsvExporter>::default(),85 ExportType::Json => Box::<JsonExporter>::default(),86 ExportType::Markdown => Box::<MarkdownExporter>::default(),87 ExportType::Orgmode => Box::<OrgmodeExporter>::default(),88 };8990 self.exporters.push(ExporterWithFilename {91 exporter,
32 unmodified lines
modified:src/cli.rs+6 added-6 removed
60 unmodified lines
61 )62 .arg(63 Arg::new("runs")64 .long("runs")65 .conflicts_with_all(&["max-runs", "min-runs"])65 .conflicts_with_all(["max-runs", "min-runs"])66 .short('r')67 .action(ArgAction::Set)68 .value_name("NUM")69 .help("Perform exactly NUM runs for each command. If this option is not specified, \
45 unmodified lines
115 .long("parameter-scan")116 .short('P')117 .action(ArgAction::Set)118 .allow_hyphen_values(true)119 .value_names(&["VAR", "MIN", "MAX"])119 .value_names(["VAR", "MIN", "MAX"])120 .help(121 "Perform benchmark runs for each value in the range MIN..MAX. Replaces the \122 string '{VAR}' in each command by the current parameter value.\n\n \123 Example: hyperfine -P threads 1 8 'make -j {threads}'\n\n\
8 unmodified lines
132 Arg::new("parameter-step-size")133 .long("parameter-step-size")134 .short('D')135 .action(ArgAction::Set)136 .value_names(&["DELTA"])136 .value_names(["DELTA"])137 .requires("parameter-scan")138 .help(139 "This argument requires --parameter-scan to be specified as well. \140 Traverse the range MIN..MAX in steps of DELTA.\n\n \
6 unmodified lines
147 .long("parameter-list")148 .short('L')149 .action(ArgAction::Append)150 .allow_hyphen_values(true)151 .value_names(&["VAR", "VALUES"])152 .conflicts_with_all(&["parameter-scan", "parameter-step-size"])151 .value_names(["VAR", "VALUES"])152 .conflicts_with_all(["parameter-scan", "parameter-step-size"])153 .help(154 "Perform benchmark runs for each value in the comma-separated list VALUES. \155 Replaces the string '{VAR}' in each command by the current parameter value\156 .\n\nExample: hyperfine -L compiler gcc,clang '{compiler} -O2 main.cpp'\n\n\
35 unmodified lines
192 .arg(193 Arg::new("no-shell")194 .short('N')195 .action(ArgAction::SetTrue)196 .conflicts_with_all(&["shell", "debug-mode"])196 .conflicts_with_all(["shell", "debug-mode"])197 .help("An alias for '--shell=none'.")198 )199 .arg(200 Arg::new("ignore-failure")
140 unmodified lines
modified:src/options.rs+2 added-2 removed
129 unmodified lines
130 let stream: Stdio = match self {131 CommandInputPolicy::Null => Stdio::null(),132133 CommandInputPolicy::File(path) => {134 let file: File = File::open(&path)?;134 let file: File = File::open(path)?;135 Stdio::from(file)136 }137 };138
31 unmodified lines
170 // Typically only stdout is performance-relevant, so just pipe that171 CommandOutputPolicy::Pipe => (Stdio::piped(), Stdio::null()),172173 CommandOutputPolicy::File(path) => {174 let file = File::create(&path)?;174 let file = File::create(path)?;175 (file.into(), Stdio::null())176 }177178 CommandOutputPolicy::Inherit => (Stdio::inherit(), Stdio::inherit()),
284 unmodified lines