From eb01a96121bd4aa20c16650d70dc6f20c85f969d Mon Sep 17 00:00:00 2001 From: MaxVerevkin Date: Wed, 27 Nov 2024 10:35:52 +0200 Subject: [PATCH] fix clippy lints --- src/color.rs | 2 +- src/config.rs | 2 +- src/i3bar_protocol.rs | 2 +- src/utils.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/color.rs b/src/color.rs index 7cb7964..45dc5b2 100644 --- a/src/color.rs +++ b/src/color.rs @@ -60,7 +60,7 @@ impl<'de> de::Deserialize<'de> for Color { { struct ColorVisitor; - impl<'de> de::Visitor<'de> for ColorVisitor { + impl de::Visitor<'_> for ColorVisitor { type Value = Color; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/src/config.rs b/src/config.rs index e84607a..48855c8 100644 --- a/src/config.rs +++ b/src/config.rs @@ -225,7 +225,7 @@ impl<'de> de::Deserialize<'de> for Font { { struct FontVisitor; - impl<'de> de::Visitor<'de> for FontVisitor { + impl de::Visitor<'_> for FontVisitor { type Value = Font; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/src/i3bar_protocol.rs b/src/i3bar_protocol.rs index d7d3f3e..d6b401b 100644 --- a/src/i3bar_protocol.rs +++ b/src/i3bar_protocol.rs @@ -174,7 +174,7 @@ impl<'de> Deserialize<'de> for MinWidth { { struct MinWidthVisitor; - impl<'de> de::Visitor<'de> for MinWidthVisitor { + impl de::Visitor<'_> for MinWidthVisitor { type Value = MinWidth; fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { diff --git a/src/utils.rs b/src/utils.rs index 826edc0..a24ed75 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -63,7 +63,7 @@ pub fn de_first_json<'a, T: Deserialize<'a>>( ) -> Result<(Option, &'a [u8]), JsonError> { while s .first() - .map_or(false, |&x| x == b' ' || x == b',' || x == b'\n') + .is_some_and(|&x| x == b' ' || x == b',' || x == b'\n') { s = &s[1..]; }