Skip to content

Commit

Permalink
Fix clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkdp committed Mar 15, 2023
1 parent 2dfc919 commit 1c7a8cc
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,16 @@ impl Default for RunBounds {
}
}

#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Default, Clone, PartialEq)]
pub enum CommandInputPolicy {
/// Read from the null device
#[default]
Null,

/// Read input from a file
File(PathBuf),
}

impl Default for CommandInputPolicy {
fn default() -> Self {
CommandInputPolicy::Null
}
}

impl CommandInputPolicy {
pub fn get_stdin(&self) -> io::Result<Stdio> {
let stream: Stdio = match self {
Expand All @@ -141,9 +136,10 @@ impl CommandInputPolicy {
}

/// How to handle the output of benchmarked commands
#[derive(Debug, Clone, PartialEq, Eq)]
#[derive(Debug, Clone, PartialEq, Eq, Default)]
pub enum CommandOutputPolicy {
/// Redirect output to the null device
#[default]
Null,

/// Feed output through a pipe before discarding it
Expand All @@ -156,12 +152,6 @@ pub enum CommandOutputPolicy {
Inherit,
}

impl Default for CommandOutputPolicy {
fn default() -> Self {
CommandOutputPolicy::Null
}
}

impl CommandOutputPolicy {
pub fn get_stdout_stderr(&self) -> io::Result<(Stdio, Stdio)> {
let streams = match self {
Expand Down

0 comments on commit 1c7a8cc

Please sign in to comment.