Skip to content

Commit

Permalink
Merge pull request #578 from nyurik/clippy
Browse files Browse the repository at this point in the history
Minor clippy nits
  • Loading branch information
KodrAus authored Aug 20, 2023
2 parents 4708f14 + 32d440a commit 6ced0fa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions benches/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ use log::kv::Value;

#[bench]
fn u8_to_value(b: &mut test::Bencher) {
b.iter(|| Value::from(1u8))
b.iter(|| Value::from(1u8));
}

#[bench]
fn u8_to_value_debug(b: &mut test::Bencher) {
b.iter(|| Value::from_debug(&1u8))
b.iter(|| Value::from_debug(&1u8));
}

#[bench]
fn str_to_value_debug(b: &mut test::Bencher) {
b.iter(|| Value::from_debug(&"a string"))
b.iter(|| Value::from_debug(&"a string"));
}

#[bench]
fn custom_to_value_debug(b: &mut test::Bencher) {
#[derive(Debug)]
struct A;

b.iter(|| Value::from_debug(&A))
b.iter(|| Value::from_debug(&A));
}
2 changes: 1 addition & 1 deletion src/kv/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ where
}

fn count(&self) -> usize {
self.as_ref().map(Source::count).unwrap_or(0)
self.as_ref().map_or(0, Source::count)
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1191,10 +1191,10 @@ where
}

fn log(&self, record: &Record) {
self.as_ref().log(record)
self.as_ref().log(record);
}
fn flush(&self) {
self.as_ref().flush()
self.as_ref().flush();
}
}

Expand All @@ -1208,10 +1208,10 @@ where
}

fn log(&self, record: &Record) {
self.as_ref().log(record)
self.as_ref().log(record);
}
fn flush(&self) {
self.as_ref().flush()
self.as_ref().flush();
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ mod tests {
fn level_token(variant: &'static str) -> Token {
Token::UnitVariant {
name: "Level",
variant: variant,
variant,
}
}

Expand All @@ -236,7 +236,7 @@ mod tests {
fn level_filter_token(variant: &'static str) -> Token {
Token::UnitVariant {
name: "LevelFilter",
variant: variant,
variant,
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ fn kv_named_args() {
fn kv_expr_context() {
match "chashu" {
cat_1 => {
info!(target: "target", cat_1 = cat_1, cat_2 = "nori"; "hello {}", "cats")
info!(target: "target", cat_1 = cat_1, cat_2 = "nori"; "hello {}", "cats");
}
};
}
Expand Down

0 comments on commit 6ced0fa

Please sign in to comment.