From 600b85ef88c05a1fa2c15c311708f2b59c0ed5d8 Mon Sep 17 00:00:00 2001 From: mdecimus Date: Tue, 3 Dec 2024 10:17:01 +1300 Subject: [PATCH] Clippy fixes --- src/arc/headers.rs | 6 +++--- src/arc/mod.rs | 4 ++-- src/arc/seal.rs | 4 ++-- src/common/auth_results.rs | 4 ++-- src/dkim/canonicalize.rs | 2 +- src/dkim/mod.rs | 2 +- src/dkim/sign.rs | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/arc/headers.rs b/src/arc/headers.rs index f88d5be..cb83487 100644 --- a/src/arc/headers.rs +++ b/src/arc/headers.rs @@ -152,7 +152,7 @@ impl Seal { } } -impl<'x> AuthenticationResults<'x> { +impl AuthenticationResults<'_> { pub(crate) fn write(&self, writer: &mut impl Writer, i: u32, as_header: bool) { writer.write(if !as_header { b"arc-authentication-results:" @@ -168,7 +168,7 @@ impl<'x> AuthenticationResults<'x> { for &ch in self.auth_results.as_bytes() { if !ch.is_ascii_whitespace() { if last_is_space { - writer.write(&[b' ']); + writer.write(b" "); last_is_space = false; } writer.write(&[ch]); @@ -183,7 +183,7 @@ impl<'x> AuthenticationResults<'x> { } } -impl<'x> HeaderWriter for ArcSet<'x> { +impl HeaderWriter for ArcSet<'_> { fn write_header(&self, writer: &mut impl Writer) { self.seal.write(writer, true); self.signature.write(writer, true); diff --git a/src/arc/mod.rs b/src/arc/mod.rs index 6d6f65d..13252f5 100644 --- a/src/arc/mod.rs +++ b/src/arc/mod.rs @@ -123,7 +123,7 @@ impl VerifySignature for Seal { } } -impl<'x> ArcOutput<'x> { +impl ArcOutput<'_> { pub(crate) fn with_result(mut self, result: DkimResult) -> Self { self.result = result; self @@ -134,7 +134,7 @@ impl<'x> ArcOutput<'x> { } } -impl<'x> Default for ArcOutput<'x> { +impl Default for ArcOutput<'_> { fn default() -> Self { Self { result: DkimResult::None, diff --git a/src/arc/seal.rs b/src/arc/seal.rs index a854e3c..b4c23e6 100644 --- a/src/arc/seal.rs +++ b/src/arc/seal.rs @@ -124,7 +124,7 @@ struct SignableSet<'a> { headers: CanonicalHeaders<'a>, } -impl<'a> Writable for SignableSet<'a> { +impl Writable for SignableSet<'_> { fn write(self, writer: &mut impl Writer) { self.headers.write(writer); self.set.signature.write(writer, false); @@ -136,7 +136,7 @@ struct SignableChain<'a> { set: &'a ArcSet<'a>, } -impl<'a> Writable for SignableChain<'a> { +impl Writable for SignableChain<'_> { fn write(self, writer: &mut impl Writer) { if !self.arc_output.set.is_empty() { Canonicalization::Relaxed.canonicalize_headers( diff --git a/src/common/auth_results.rs b/src/common/auth_results.rs index d8c384a..b319025 100644 --- a/src/common/auth_results.rs +++ b/src/common/auth_results.rs @@ -149,14 +149,14 @@ impl<'x> AuthenticationResults<'x> { } } -impl<'x> Display for AuthenticationResults<'x> { +impl Display for AuthenticationResults<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.write_str(self.hostname)?; f.write_str(&self.auth_results) } } -impl<'x> HeaderWriter for AuthenticationResults<'x> { +impl HeaderWriter for AuthenticationResults<'_> { fn write_header(&self, writer: &mut impl Writer) { writer.write(b"Authentication-Results: "); writer.write(self.hostname.as_bytes()); diff --git a/src/dkim/canonicalize.rs b/src/dkim/canonicalize.rs index 7a21b6c..aa67446 100644 --- a/src/dkim/canonicalize.rs +++ b/src/dkim/canonicalize.rs @@ -200,7 +200,7 @@ pub struct CanonicalHeaders<'a> { headers: Vec<(&'a [u8], &'a [u8])>, } -impl<'a> Writable for CanonicalHeaders<'a> { +impl Writable for CanonicalHeaders<'_> { fn write(self, writer: &mut impl Writer) { self.canonicalization .canonicalize_headers(self.headers.into_iter().rev(), writer) diff --git a/src/dkim/mod.rs b/src/dkim/mod.rs index ea08812..2c03ec4 100644 --- a/src/dkim/mod.rs +++ b/src/dkim/mod.rs @@ -235,7 +235,7 @@ impl<'x> DkimOutput<'x> { } } -impl<'x> ArcOutput<'x> { +impl ArcOutput<'_> { pub fn result(&self) -> &DkimResult { &self.result } diff --git a/src/dkim/sign.rs b/src/dkim/sign.rs index e3ef82c..830dd5d 100644 --- a/src/dkim/sign.rs +++ b/src/dkim/sign.rs @@ -96,7 +96,7 @@ pub(super) struct SignableMessage<'a> { signature: &'a Signature, } -impl<'a> Writable for SignableMessage<'a> { +impl Writable for SignableMessage<'_> { fn write(self, writer: &mut impl Writer) { self.headers.write(writer); self.signature.write(writer, false);