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
Provenance
- Commit
c7e5694- Tree
e6bf6dc- Author
David Peter <mail@david-peter.de>- Committer
David Peter <david.peter@bosch.com>- Parent
790e1bf
5 files changed+8 added−8 removed
modified:src/export/json.rs+1 added-1 removed
16 unmodified lines17 18 impl 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 }24 25 Ok(output?)2 unmodified linesmodified:src/parameter/mod.rs+1 added-1 removed
7 unmodified lines8 Text(String),9 Numeric(Number),10 }11 12-impl<'a> ToString for ParameterValue {12+impl 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 linesmodified:src/util/units.rs+1 added-1 removed
4 unmodified lines5 /// Type alias for unit of time6 pub type Second = Scalar;7 8 /// Supported time units9-#[derive(Debug, Clone, Copy, PartialEq)]9+#[derive(Debug, Clone, Copy, PartialEq, Eq)]10 pub enum Unit {11 Second,12 MilliSecond,13 }32 unmodified linesmodified:src/command.rs+2 added-2 removed
177 unmodified lines178 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;185 186 let (command_index, params_indices) = index.split_first().unwrap();83 unmodified lines270 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 linesmodified:src/options.rs+3 added-3 removed
65 unmodified lines66 }67 }68 69 /// Action to take when an executed command fails.70-#[derive(Debug, Clone, Copy, PartialEq)]70+#[derive(Debug, Clone, Copy, PartialEq, Eq)]71 pub enum CmdFailureAction {72 /// Exit with an error message73 RaiseError,74 1 unmodified line76 Ignore,77 }78 79 /// Output style type option80-#[derive(Debug, Clone, Copy, PartialEq)]80+#[derive(Debug, Clone, Copy, PartialEq, Eq)]81 pub enum OutputStyleOption {82 /// Do not output with colors or any special formatting83 Basic,84 25 unmodified lines110 }111 }112 113 /// How to handle the output of benchmarked commands114-#[derive(Debug, Clone, PartialEq)]114+#[derive(Debug, Clone, PartialEq, Eq)]115 pub enum CommandOutputPolicy {116 /// Redirect output to the null device117 Null,118 295 unmodified lines