diff --git a/src/address/types.rs b/src/address/types.rs index 6aba26e..4372daf 100644 --- a/src/address/types.rs +++ b/src/address/types.rs @@ -226,7 +226,7 @@ fn check_address(val: &str) -> Result { Ok(user.len()) } -#[derive(Debug, PartialEq, Clone, Copy)] +#[derive(Debug, PartialEq, Eq, Clone, Copy)] /// Errors in email addresses parsing pub enum AddressError { /// Missing domain or user diff --git a/src/executor.rs b/src/executor.rs index 99adaa7..43d31bc 100644 --- a/src/executor.rs +++ b/src/executor.rs @@ -109,7 +109,6 @@ impl Executor for Tokio1Executor { #[cfg(feature = "smtp-transport")] type Sleep = tokio1_crate::time::Sleep; - #[doc(hidden)] #[cfg(feature = "smtp-transport")] fn spawn(fut: F) -> Self::Handle where @@ -119,13 +118,11 @@ impl Executor for Tokio1Executor { tokio1_crate::spawn(fut) } - #[doc(hidden)] #[cfg(feature = "smtp-transport")] fn sleep(duration: Duration) -> Self::Sleep { tokio1_crate::time::sleep(duration) } - #[doc(hidden)] #[cfg(feature = "smtp-transport")] async fn connect( hostname: &str, @@ -166,13 +163,11 @@ impl Executor for Tokio1Executor { Ok(conn) } - #[doc(hidden)] #[cfg(feature = "file-transport-envelope")] async fn fs_read(path: &Path) -> IoResult> { tokio1_crate::fs::read(path).await } - #[doc(hidden)] #[cfg(feature = "file-transport")] async fn fs_write(path: &Path, contents: &[u8]) -> IoResult<()> { tokio1_crate::fs::write(path, contents).await @@ -210,7 +205,6 @@ impl Executor for AsyncStd1Executor { #[cfg(feature = "smtp-transport")] type Sleep = BoxFuture<'static, ()>; - #[doc(hidden)] #[cfg(feature = "smtp-transport")] fn spawn(fut: F) -> Self::Handle where @@ -220,14 +214,12 @@ impl Executor for AsyncStd1Executor { async_std::task::spawn(fut) } - #[doc(hidden)] #[cfg(feature = "smtp-transport")] fn sleep(duration: Duration) -> Self::Sleep { let fut = async move { async_std::task::sleep(duration).await }; Box::pin(fut) } - #[doc(hidden)] #[cfg(feature = "smtp-transport")] async fn connect( hostname: &str, @@ -267,13 +259,11 @@ impl Executor for AsyncStd1Executor { Ok(conn) } - #[doc(hidden)] #[cfg(feature = "file-transport-envelope")] async fn fs_read(path: &Path) -> IoResult> { async_std::fs::read(path).await } - #[doc(hidden)] #[cfg(feature = "file-transport")] async fn fs_write(path: &Path, contents: &[u8]) -> IoResult<()> { async_std::fs::write(path, contents).await diff --git a/src/message/dkim.rs b/src/message/dkim.rs index e6bf7b7..81015dc 100644 --- a/src/message/dkim.rs +++ b/src/message/dkim.rs @@ -96,9 +96,9 @@ impl Display for DkimSigningKeyError { impl StdError for DkimSigningKeyError { fn source(&self) -> Option<&(dyn StdError + 'static)> { Some(match &self.0 { - InnerDkimSigningKeyError::Base64(err) => &*err, - InnerDkimSigningKeyError::Rsa(err) => &*err, - InnerDkimSigningKeyError::Ed25519(err) => &*err, + InnerDkimSigningKeyError::Base64(err) => err, + InnerDkimSigningKeyError::Rsa(err) => err, + InnerDkimSigningKeyError::Ed25519(err) => err, }) } } @@ -245,7 +245,7 @@ fn dkim_canonicalize_headers_relaxed(headers: &str) -> String { let mut r = String::with_capacity(headers.len()); fn skip_whitespace(h: &str) -> &str { - match h.as_bytes().get(0) { + match h.as_bytes().first() { Some(b' ' | b'\t') => skip_whitespace(&h[1..]), _ => h, } diff --git a/src/message/header/date.rs b/src/message/header/date.rs index c1fe98f..71e73db 100644 --- a/src/message/header/date.rs +++ b/src/message/header/date.rs @@ -8,7 +8,7 @@ use crate::BoxError; /// Message `Date` header /// /// Defined in [RFC2822](https://tools.ietf.org/html/rfc2822#section-3.3) -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct Date(HttpDate); impl Date { diff --git a/src/message/header/mailbox.rs b/src/message/header/mailbox.rs index 7ca4ba1..25c0235 100644 --- a/src/message/header/mailbox.rs +++ b/src/message/header/mailbox.rs @@ -14,7 +14,7 @@ pub trait MailboxesHeader { macro_rules! mailbox_header { ($(#[$doc:meta])*($type_name: ident, $header_name: expr)) => { $(#[$doc])* - #[derive(Debug, Clone, PartialEq)] + #[derive(Debug, Clone, PartialEq, Eq)] pub struct $type_name(Mailbox); impl Header for $type_name { @@ -56,7 +56,7 @@ macro_rules! mailbox_header { macro_rules! mailboxes_header { ($(#[$doc:meta])*($type_name: ident, $header_name: expr)) => { $(#[$doc])* - #[derive(Debug, Clone, PartialEq)] + #[derive(Debug, Clone, PartialEq, Eq)] pub struct $type_name(pub(crate) Mailboxes); impl MailboxesHeader for $type_name { diff --git a/src/message/header/special.rs b/src/message/header/special.rs index f1a3f3b..32e5bfd 100644 --- a/src/message/header/special.rs +++ b/src/message/header/special.rs @@ -4,7 +4,7 @@ use crate::{ }; /// Message format version, defined in [RFC2045](https://tools.ietf.org/html/rfc2045#section-4) -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct MimeVersion { major: u8, minor: u8, diff --git a/src/message/header/textual.rs b/src/message/header/textual.rs index bf8c628..9006547 100644 --- a/src/message/header/textual.rs +++ b/src/message/header/textual.rs @@ -4,7 +4,7 @@ use crate::BoxError; macro_rules! text_header { ($(#[$attr:meta])* Header($type_name: ident, $header_name: expr )) => { $(#[$attr])* - #[derive(Debug, Clone, PartialEq)] + #[derive(Debug, Clone, PartialEq, Eq)] pub struct $type_name(String); impl Header for $type_name { diff --git a/src/transport/smtp/commands.rs b/src/transport/smtp/commands.rs index f5d06b2..847372c 100644 --- a/src/transport/smtp/commands.rs +++ b/src/transport/smtp/commands.rs @@ -13,7 +13,7 @@ use crate::{ }; /// EHLO command -#[derive(PartialEq, Clone, Debug)] +#[derive(PartialEq, Eq, Clone, Debug)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Ehlo { client_id: ClientId, @@ -33,7 +33,7 @@ impl Ehlo { } /// STARTTLS command -#[derive(PartialEq, Clone, Debug, Copy)] +#[derive(PartialEq, Eq, Clone, Debug, Copy)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Starttls; @@ -44,7 +44,7 @@ impl Display for Starttls { } /// MAIL command -#[derive(PartialEq, Clone, Debug)] +#[derive(PartialEq, Eq, Clone, Debug)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Mail { sender: Option
, @@ -73,7 +73,7 @@ impl Mail { } /// RCPT command -#[derive(PartialEq, Clone, Debug)] +#[derive(PartialEq, Eq, Clone, Debug)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Rcpt { recipient: Address, @@ -101,7 +101,7 @@ impl Rcpt { } /// DATA command -#[derive(PartialEq, Clone, Debug, Copy)] +#[derive(PartialEq, Eq, Clone, Debug, Copy)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Data; @@ -112,7 +112,7 @@ impl Display for Data { } /// QUIT command -#[derive(PartialEq, Clone, Debug, Copy)] +#[derive(PartialEq, Eq, Clone, Debug, Copy)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Quit; @@ -123,7 +123,7 @@ impl Display for Quit { } /// NOOP command -#[derive(PartialEq, Clone, Debug, Copy)] +#[derive(PartialEq, Eq, Clone, Debug, Copy)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Noop; @@ -134,7 +134,7 @@ impl Display for Noop { } /// HELP command -#[derive(PartialEq, Clone, Debug)] +#[derive(PartialEq, Eq, Clone, Debug)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Help { argument: Option, @@ -158,7 +158,7 @@ impl Help { } /// VRFY command -#[derive(PartialEq, Clone, Debug)] +#[derive(PartialEq, Eq, Clone, Debug)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Vrfy { argument: String, @@ -178,7 +178,7 @@ impl Vrfy { } /// EXPN command -#[derive(PartialEq, Clone, Debug)] +#[derive(PartialEq, Eq, Clone, Debug)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Expn { argument: String, @@ -198,7 +198,7 @@ impl Expn { } /// RSET command -#[derive(PartialEq, Clone, Debug, Copy)] +#[derive(PartialEq, Eq, Clone, Debug, Copy)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Rset; @@ -209,7 +209,7 @@ impl Display for Rset { } /// AUTH command -#[derive(PartialEq, Clone, Debug)] +#[derive(PartialEq, Eq, Clone, Debug)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Auth { mechanism: Mechanism,