diff --git a/lettre/src/lib.rs b/lettre/src/lib.rs index 9f6cfd7..9473bde 100644 --- a/lettre/src/lib.rs +++ b/lettre/src/lib.rs @@ -86,7 +86,7 @@ impl AsRef for EmailAddress { impl AsRef for EmailAddress { fn as_ref(&self) -> &OsStr { - &self.0.as_ref() + self.0.as_ref() } } diff --git a/lettre/src/smtp/client/mod.rs b/lettre/src/smtp/client/mod.rs index 046e6cd..663c493 100644 --- a/lettre/src/smtp/client/mod.rs +++ b/lettre/src/smtp/client/mod.rs @@ -28,9 +28,7 @@ impl ClientCodec { pub fn new() -> Self { ClientCodec::default() } -} -impl ClientCodec { /// Adds transparency /// TODO: replace CR and LF by CRLF fn encode(&mut self, frame: &[u8], buf: &mut Vec) -> Result<(), Error> { diff --git a/lettre/src/smtp/mod.rs b/lettre/src/smtp/mod.rs index 9018bb9..9ebca28 100644 --- a/lettre/src/smtp/mod.rs +++ b/lettre/src/smtp/mod.rs @@ -470,7 +470,7 @@ impl<'a> Transport<'a> for SmtpTransport { // Message content let result = self.client.message(Box::new(email.message())); - if result.is_ok() { + if let Ok(ref result) = result { // Increment the connection reuse counter self.state.connection_reuse_count += 1; @@ -480,9 +480,6 @@ impl<'a> Transport<'a> for SmtpTransport { message_id, self.state.connection_reuse_count, result - .as_ref() - .ok() - .unwrap() .message .iter() .next()