diff options
author | David Peter <mail@david-peter.de> | 2023-03-15 09:49:43 +0100 |
---|---|---|
committer | David Peter <mail@david-peter.de> | 2023-03-15 09:49:43 +0100 |
commit | de78139aea32607d0067aca2b6210ad96d7f5fe6 (patch) | |
tree | 4d9d6922212a272928dc6a3c441a52806ca7d77c | |
parent | 88870c13c2a5e3757a78a5c87243b8bdbf65ccf4 (diff) |
Fix clippy suggestions
-rw-r--r-- | src/cli.rs | 12 | ||||
-rw-r--r-- | src/export/mod.rs | 10 | ||||
-rw-r--r-- | src/options.rs | 4 |
3 files changed, 13 insertions, 13 deletions
@@ -62,7 +62,7 @@ fn build_command() -> Command { .arg( Arg::new("runs") .long("runs") - .conflicts_with_all(&["max-runs", "min-runs"]) + .conflicts_with_all(["max-runs", "min-runs"]) .short('r') .action(ArgAction::Set) .value_name("NUM") @@ -116,7 +116,7 @@ fn build_command() -> Command { .short('P') .action(ArgAction::Set) .allow_hyphen_values(true) - .value_names(&["VAR", "MIN", "MAX"]) + .value_names(["VAR", "MIN", "MAX"]) .help( "Perform benchmark runs for each value in the range MIN..MAX. Replaces the \ string '{VAR}' in each command by the current parameter value.\n\n \ @@ -133,7 +133,7 @@ fn build_command() -> Command { .long("parameter-step-size") .short('D') .action(ArgAction::Set) - .value_names(&["DELTA"]) + .value_names(["DELTA"]) .requires("parameter-scan") .help( "This argument requires --parameter-scan to be specified as well. \ @@ -148,8 +148,8 @@ fn build_command() -> Command { .short('L') .action(ArgAction::Append) .allow_hyphen_values(true) - .value_names(&["VAR", "VALUES"]) - .conflicts_with_all(&["parameter-scan", "parameter-step-size"]) + .value_names(["VAR", "VALUES"]) + .conflicts_with_all(["parameter-scan", "parameter-step-size"]) .help( "Perform benchmark runs for each value in the comma-separated list VALUES. \ Replaces the string '{VAR}' in each command by the current parameter value\ @@ -193,7 +193,7 @@ fn build_command() -> Command { Arg::new("no-shell") .short('N') .action(ArgAction::SetTrue) - .conflicts_with_all(&["shell", "debug-mode"]) + .conflicts_with_all(["shell", "debug-mode"]) .help("An alias for '--shell=none'.") ) .arg( diff --git a/src/export/mod.rs b/src/export/mod.rs index 21b159d..fec1016 100644 --- a/src/export/mod.rs +++ b/src/export/mod.rs @@ -80,11 +80,11 @@ impl ExportManager { /// Add an additional exporter to the ExportManager pub fn add_exporter(&mut self, export_type: ExportType, filename: &str) -> Result<()> { let exporter: Box<dyn Exporter> = match export_type { - ExportType::Asciidoc => Box::new(AsciidocExporter::default()), - ExportType::Csv => Box::new(CsvExporter::default()), - ExportType::Json => Box::new(JsonExporter::default()), - ExportType::Markdown => Box::new(MarkdownExporter::default()), - ExportType::Orgmode => Box::new(OrgmodeExporter::default()), + ExportType::Asciidoc => Box::<AsciidocExporter>::default(), + ExportType::Csv => Box::<CsvExporter>::default(), + ExportType::Json => Box::<JsonExporter>::default(), + ExportType::Markdown => Box::<MarkdownExporter>::default(), + ExportType::Orgmode => Box::<OrgmodeExporter>::default(), }; self.exporters.push(ExporterWithFilename { diff --git a/src/options.rs b/src/options.rs index 8a8caf4..f07d13c 100644 --- a/src/options.rs +++ b/src/options.rs @@ -131,7 +131,7 @@ impl CommandInputPolicy { CommandInputPolicy::Null => Stdio::null(), CommandInputPolicy::File(path) => { - let file: File = File::open(&path)?; + let file: File = File::open(path)?; Stdio::from(file) } }; @@ -171,7 +171,7 @@ impl CommandOutputPolicy { CommandOutputPolicy::Pipe => (Stdio::piped(), Stdio::null()), CommandOutputPolicy::File(path) => { - let file = File::create(&path)?; + let file = File::create(path)?; (file.into(), Stdio::null()) } |