Skip to content

Commit

Permalink
Clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mdecimus committed Dec 2, 2024
1 parent 9cadc33 commit 600b85e
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/arc/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand All @@ -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]);
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/arc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/arc/seal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions src/common/auth_results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/dkim/canonicalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/dkim/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ impl<'x> DkimOutput<'x> {
}
}

impl<'x> ArcOutput<'x> {
impl ArcOutput<'_> {
pub fn result(&self) -> &DkimResult {
&self.result
}
Expand Down
2 changes: 1 addition & 1 deletion src/dkim/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 600b85e

Please sign in to comment.