Fix clippy suggestions

This commit is contained in:
David Peter authored and David Peter committed 2022-09-07 09:20:50 +02:00
1 parent 790e1bfa2c
commit c7e56942f7
5 files changed
+8 -8

No files matched your search

+2 -2
View File
@@ -179,7 +179,7 @@ impl<'a> Commands<'a> {
'outer: loop {
let name = command_names
.get(i)
.or_else(|| command_names.get(0))
.or_else(|| command_names.first())
.copied();
i += 1;
@@ -271,7 +271,7 @@ impl<'a> Commands<'a> {
for cmd in &command_strings {
let name = command_names
.get(i)
.or_else(|| command_names.get(0))
.or_else(|| command_names.first())
.copied();
commands.push(Command::new_parametrized(
name,
+1 -1
View File
@@ -18,7 +18,7 @@ pub struct JsonExporter {}
impl Exporter for JsonExporter {
fn serialize(&self, results: &[BenchmarkResult], _unit: Option<Unit>) -> Result<Vec<u8>> {
let mut output = to_vec_pretty(&HyperfineSummary { results });
for content in output.iter_mut() {
if let Ok(ref mut content) = output {
content.push(b'\n');
}
+3 -3
View File
@@ -67,7 +67,7 @@ impl Shell {
}
/// Action to take when an executed command fails.
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum CmdFailureAction {
/// Exit with an error message
RaiseError,
@@ -77,7 +77,7 @@ pub enum CmdFailureAction {
}
/// Output style type option
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum OutputStyleOption {
/// Do not output with colors or any special formatting
Basic,
@@ -111,7 +111,7 @@ impl Default for RunBounds {
}
/// How to handle the output of benchmarked commands
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum CommandOutputPolicy {
/// Redirect output to the null device
Null,
+1 -1
View File
@@ -9,7 +9,7 @@ pub enum ParameterValue {
Numeric(Number),
}
impl<'a> ToString for ParameterValue {
impl ToString for ParameterValue {
fn to_string(&self) -> String {
match self {
ParameterValue::Text(ref value) => value.clone(),
+1 -1
View File
@@ -6,7 +6,7 @@ pub type Scalar = f64;
pub type Second = Scalar;
/// Supported time units
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Unit {
Second,
MilliSecond,