Skip to content

Commit

Permalink
Clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mdecimus committed Dec 1, 2024
1 parent 0eba00b commit 9bf766d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/core/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

use crate::{AttachmentIterator, BodyPartIterator, Message, MessagePart, MessagePartId, PartType};

impl<'x> PartType<'x> {
impl PartType<'_> {
#[allow(clippy::len_without_is_empty)]
pub fn len(&self) -> usize {
match self {
Expand Down
10 changes: 5 additions & 5 deletions src/core/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ impl PartialEq for HeaderName<'_> {
}
}

impl<'x> Hash for HeaderName<'x> {
impl Hash for HeaderName<'_> {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
match self {
HeaderName::Other(value) => {
Expand All @@ -280,7 +280,7 @@ impl<'x> From<HeaderName<'x>> for u8 {
}
}

impl<'x> HeaderName<'x> {
impl HeaderName<'_> {
pub fn to_owned(&self) -> HeaderName<'static> {
match self {
HeaderName::Other(name) => HeaderName::Other(name.to_string().into()),
Expand Down Expand Up @@ -712,7 +712,7 @@ impl<'x> MessagePart<'x> {
}
}

impl<'x> fmt::Display for MessagePart<'x> {
impl fmt::Display for MessagePart<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.write_str(self.text_contents().unwrap_or("[no contents]"))
}
Expand Down Expand Up @@ -911,7 +911,7 @@ impl<'x> Received<'x> {
}

/// A hostname or IP address.
impl<'x> Host<'x> {
impl Host<'_> {
pub fn into_owned(self) -> Host<'static> {
match self {
Host::Name(name) => Host::Name(name.into_owned().into()),
Expand Down Expand Up @@ -946,7 +946,7 @@ impl<'x> From<Cow<'x, str>> for HeaderName<'x> {
}
}

impl<'x> From<String> for HeaderName<'x> {
impl From<String> for HeaderName<'_> {
fn from(value: String) -> Self {
HeaderName::parse(value).unwrap_or(HeaderName::Other("".into()))
}
Expand Down
2 changes: 1 addition & 1 deletion src/decoders/encoded_word.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ enum Rfc2047State {
Data,
}

impl<'x> MessageStream<'x> {
impl MessageStream<'_> {
pub fn decode_rfc2047(&mut self) -> Option<String> {
let mut state = Rfc2047State::Init;

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ pub enum PartType<'x> {
Multipart(Vec<MessagePartId>),
}

impl<'x> Default for PartType<'x> {
impl Default for PartType<'_> {
fn default() -> Self {
PartType::Multipart(Vec::with_capacity(0))
}
Expand Down
4 changes: 2 additions & 2 deletions src/parsers/fields/received.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ impl<'x> MessageStream<'x> {
}
}

impl<'x, 'y> Iterator for Tokenizer<'x, 'y> {
impl<'x> Iterator for Tokenizer<'x, '_> {
type Item = TokenData<'x>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -789,7 +789,7 @@ impl<'x, 'y> Tokenizer<'x, 'y> {
}
}

impl<'x> From<Token> for TokenData<'x> {
impl From<Token> for TokenData<'_> {
fn from(token: Token) -> Self {
Self {
token,
Expand Down

0 comments on commit 9bf766d

Please sign in to comment.