diff options
author | David Peter <mail@david-peter.de> | 2023-03-15 10:08:20 +0100 |
---|---|---|
committer | David Peter <mail@david-peter.de> | 2023-03-15 10:08:20 +0100 |
commit | 9b596b38738f614296a0609684ba56a514ff9d39 (patch) | |
tree | 0aec7a3b248915f526533f5744c76c8a8ebf9493 | |
parent | 04e2f6378ed4c98e936dd2b7b75272182381e749 (diff) |
Fix clippy suggestionshyperfine-1.16
-rw-r--r-- | src/options.rs | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/options.rs b/src/options.rs index f07d13c..eee51e0 100644 --- a/src/options.rs +++ b/src/options.rs @@ -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 { @@ -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 @@ -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 { |