style(all): Minor code cleanup

This commit is contained in:
mibac138
2019-11-30 17:55:49 +01:00
parent ff6a4ff910
commit 14fac980ed
3 changed files with 2 additions and 7 deletions

View File

@@ -86,7 +86,7 @@ impl AsRef<str> for EmailAddress {
impl AsRef<OsStr> for EmailAddress {
fn as_ref(&self) -> &OsStr {
&self.0.as_ref()
self.0.as_ref()
}
}

View File

@@ -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<u8>) -> Result<(), Error> {

View File

@@ -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()