mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 08:50:19 +00:00
Fix clippy suggestions
This commit is contained in:
1 parent
790e1bfa2c
commit
c7e56942f7
5 files changed
+8
-8
No files matched your search
+2
-2
@@ -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
@@ -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
@@ -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,
|
||||
|
||||
@@ -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
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user