style(all): Minor code cleanup
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user