Fix clippy suggestions

This commit is contained in:
David Peter authored and David Peter committed 2023-03-15 10:13:58 +01:00
1 parent 2dfc919227
commit 1c7a8cc2f6
1 file changed
+4 -14
+4 -14
View File
@@ -110,21 +110,16 @@ impl Default for RunBounds {
} }
} }
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Default, Clone, PartialEq)]
pub enum CommandInputPolicy { pub enum CommandInputPolicy {
/// Read from the null device /// Read from the null device
#[default]
Null, Null,
/// Read input from a file /// Read input from a file
File(PathBuf), File(PathBuf),
} }
impl Default for CommandInputPolicy {
fn default() -> Self {
CommandInputPolicy::Null
}
}
impl CommandInputPolicy { impl CommandInputPolicy {
pub fn get_stdin(&self) -> io::Result<Stdio> { pub fn get_stdin(&self) -> io::Result<Stdio> {
let stream: Stdio = match self { let stream: Stdio = match self {
@@ -141,9 +136,10 @@ impl CommandInputPolicy {
} }
/// How to handle the output of benchmarked commands /// How to handle the output of benchmarked commands
#[derive(Debug, Clone, PartialEq, Eq)] #[derive(Debug, Clone, PartialEq, Eq, Default)]
pub enum CommandOutputPolicy { pub enum CommandOutputPolicy {
/// Redirect output to the null device /// Redirect output to the null device
#[default]
Null, Null,
/// Feed output through a pipe before discarding it /// Feed output through a pipe before discarding it
@@ -156,12 +152,6 @@ pub enum CommandOutputPolicy {
Inherit, Inherit,
} }
impl Default for CommandOutputPolicy {
fn default() -> Self {
CommandOutputPolicy::Null
}
}
impl CommandOutputPolicy { impl CommandOutputPolicy {
pub fn get_stdout_stderr(&self) -> io::Result<(Stdio, Stdio)> { pub fn get_stdout_stderr(&self) -> io::Result<(Stdio, Stdio)> {
let streams = match self { let streams = match self {