Skip to content

Commit

Permalink
Fix clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkdp authored and David Peter committed Sep 7, 2022
1 parent 790e1bf commit c7e5694
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/export/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
6 changes: 3 additions & 3 deletions src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/parameter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion src/util/units.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c7e5694

Please sign in to comment.