WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit c7e5694

Browse files
sharkdpDavid Peter
authored andcommitted
Fix clippy suggestions
1 parent 790e1bf commit c7e5694

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/command.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ impl<'a> Commands<'a> {
179179
'outer: loop {
180180
let name = command_names
181181
.get(i)
182-
.or_else(|| command_names.get(0))
182+
.or_else(|| command_names.first())
183183
.copied();
184184
i += 1;
185185

@@ -271,7 +271,7 @@ impl<'a> Commands<'a> {
271271
for cmd in &command_strings {
272272
let name = command_names
273273
.get(i)
274-
.or_else(|| command_names.get(0))
274+
.or_else(|| command_names.first())
275275
.copied();
276276
commands.push(Command::new_parametrized(
277277
name,

src/export/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub struct JsonExporter {}
1818
impl Exporter for JsonExporter {
1919
fn serialize(&self, results: &[BenchmarkResult], _unit: Option<Unit>) -> Result<Vec<u8>> {
2020
let mut output = to_vec_pretty(&HyperfineSummary { results });
21-
for content in output.iter_mut() {
21+
if let Ok(ref mut content) = output {
2222
content.push(b'\n');
2323
}
2424

src/options.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl Shell {
6767
}
6868

6969
/// Action to take when an executed command fails.
70-
#[derive(Debug, Clone, Copy, PartialEq)]
70+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
7171
pub enum CmdFailureAction {
7272
/// Exit with an error message
7373
RaiseError,
@@ -77,7 +77,7 @@ pub enum CmdFailureAction {
7777
}
7878

7979
/// Output style type option
80-
#[derive(Debug, Clone, Copy, PartialEq)]
80+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
8181
pub enum OutputStyleOption {
8282
/// Do not output with colors or any special formatting
8383
Basic,
@@ -111,7 +111,7 @@ impl Default for RunBounds {
111111
}
112112

113113
/// How to handle the output of benchmarked commands
114-
#[derive(Debug, Clone, PartialEq)]
114+
#[derive(Debug, Clone, PartialEq, Eq)]
115115
pub enum CommandOutputPolicy {
116116
/// Redirect output to the null device
117117
Null,

src/parameter/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub enum ParameterValue {
99
Numeric(Number),
1010
}
1111

12-
impl<'a> ToString for ParameterValue {
12+
impl ToString for ParameterValue {
1313
fn to_string(&self) -> String {
1414
match self {
1515
ParameterValue::Text(ref value) => value.clone(),

src/util/units.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub type Scalar = f64;
66
pub type Second = Scalar;
77

88
/// Supported time units
9-
#[derive(Debug, Clone, Copy, PartialEq)]
9+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
1010
pub enum Unit {
1111
Second,
1212
MilliSecond,

0 commit comments

Comments
 (0)