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 790e1bf · Browse files · 5 files+8 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

5 files+8 added−8 removed

  • other:+8 added−8 removed

5 files+8 added−8 removed

modified:src/export/json.rs+1 added-1 removed
16 unmodified lines
1718impl Exporter for JsonExporter {19 fn serialize(&self, results: &[BenchmarkResult], _unit: Option<Unit>) -> Result<Vec<u8>> {20 let mut output = to_vec_pretty(&HyperfineSummary { results });21 for content in output.iter_mut() {21 if let Ok(ref mut content) = output {22 content.push(b'\n');23 }2425 Ok(output?)
2 unmodified lines
modified:src/parameter/mod.rs+1 added-1 removed
7 unmodified lines
8 Text(String),9 Numeric(Number),10}1112impl<'a> ToString for ParameterValue {12impl ToString for ParameterValue {13 fn to_string(&self) -> String {14 match self {15 ParameterValue::Text(ref value) => value.clone(),16 ParameterValue::Numeric(value) => value.to_string(),
5 unmodified lines
modified:src/util/units.rs+1 added-1 removed
4 unmodified lines
5/// Type alias for unit of time6pub type Second = Scalar;78/// Supported time units9#[derive(Debug, Clone, Copy, PartialEq)]9#[derive(Debug, Clone, Copy, PartialEq, Eq)]10pub enum Unit {11 Second,12 MilliSecond,13}
32 unmodified lines
modified:src/command.rs+2 added-2 removed
177 unmodified lines
178 let mut index = vec![0usize; dimensions.len()];179 'outer: loop {180 let name = command_names181 .get(i)182 .or_else(|| command_names.get(0))182 .or_else(|| command_names.first())183 .copied();184 i += 1;185186 let (command_index, params_indices) = index.split_first().unwrap();
83 unmodified lines
270 for value in param_range {271 for cmd in &command_strings {272 let name = command_names273 .get(i)274 .or_else(|| command_names.get(0))274 .or_else(|| command_names.first())275 .copied();276 commands.push(Command::new_parametrized(277 name,278 cmd,
259 unmodified lines
modified:src/options.rs+3 added-3 removed
65 unmodified lines
66 }67}6869/// Action to take when an executed command fails.70#[derive(Debug, Clone, Copy, PartialEq)]70#[derive(Debug, Clone, Copy, PartialEq, Eq)]71pub enum CmdFailureAction {72 /// Exit with an error message73 RaiseError,74
1 unmodified line
76 Ignore,77}7879/// Output style type option80#[derive(Debug, Clone, Copy, PartialEq)]80#[derive(Debug, Clone, Copy, PartialEq, Eq)]81pub enum OutputStyleOption {82 /// Do not output with colors or any special formatting83 Basic,84
25 unmodified lines
110 }111}112113/// How to handle the output of benchmarked commands114#[derive(Debug, Clone, PartialEq)]114#[derive(Debug, Clone, PartialEq, Eq)]115pub enum CommandOutputPolicy {116 /// Redirect output to the null device117 Null,118
295 unmodified lines