Fix latest clippy warnings (#655)

This commit is contained in:
Paolo Barbolini
2021-08-02 11:26:34 +02:00
committed by GitHub
parent 9f550bce86
commit 55c2618201
9 changed files with 13 additions and 13 deletions

View File

@@ -183,8 +183,8 @@ impl MaybeString {
/// would result into an invalid encoded body.
fn is_encoding_ok(&self, encoding: ContentTransferEncoding) -> bool {
match encoding {
ContentTransferEncoding::SevenBit => is_7bit_encoded(&self),
ContentTransferEncoding::EightBit => is_8bit_encoded(&self),
ContentTransferEncoding::SevenBit => is_7bit_encoded(self),
ContentTransferEncoding::EightBit => is_8bit_encoded(self),
ContentTransferEncoding::Binary
| ContentTransferEncoding::QuotedPrintable
| ContentTransferEncoding::Base64 => true,
@@ -342,7 +342,7 @@ where
/// In place conversion to CRLF line endings
fn in_place_crlf_line_endings(string: &mut String) {
let indices = find_all_lf_char_indices(&string);
let indices = find_all_lf_char_indices(string);
for i in indices {
// this relies on `indices` being in reverse order

View File

@@ -163,7 +163,7 @@ impl Display for Headers {
for (name, value) in &self.headers {
Display::fmt(name, f)?;
f.write_str(": ")?;
HeaderValueEncoder::encode(&name, &value, f)?;
HeaderValueEncoder::encode(name, value, f)?;
f.write_str("\r\n")?;
}
@@ -240,7 +240,7 @@ impl HeaderName {
impl Display for HeaderName {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(&self)
f.write_str(self)
}
}

View File

@@ -70,7 +70,7 @@ impl Display for Mailbox {
if let Some(ref name) = self.name {
let name = name.trim();
if !name.is_empty() {
f.write_str(&name)?;
f.write_str(name)?;
f.write_str(" <")?;
self.email.fmt(f)?;
return f.write_char('>');

View File

@@ -523,7 +523,7 @@ impl EmailFormat for Message {
MessageBody::Mime(p) => p.format(out),
MessageBody::Raw(r) => {
out.extend_from_slice(b"\r\n");
out.extend_from_slice(&r)
out.extend_from_slice(r)
}
}
}

View File

@@ -152,7 +152,7 @@ pub trait AsyncTransport {
async fn send(&self, message: Message) -> Result<Self::Ok, Self::Error> {
let raw = message.formatted();
let envelope = message.envelope();
self.send_raw(&envelope, &raw).await
self.send_raw(envelope, &raw).await
}
async fn send_raw(&self, envelope: &Envelope, email: &[u8]) -> Result<Self::Ok, Self::Error>;

View File

@@ -260,7 +260,7 @@ impl AsyncTransport for AsyncSendmailTransport<AsyncStd1Executor> {
.stdin
.as_mut()
.unwrap()
.write_all(&email)
.write_all(email)
.await
.map_err(error::client)?;
let output = process.output().await.map_err(error::client)?;
@@ -292,7 +292,7 @@ impl AsyncTransport for AsyncSendmailTransport<Tokio1Executor> {
.stdin
.as_mut()
.unwrap()
.write_all(&email)
.write_all(email)
.await
.map_err(error::client)?;
let output = process.wait_with_output().await.map_err(error::client)?;

View File

@@ -301,7 +301,7 @@ where
.await?;
if let Some(credentials) = &self.info.credentials {
conn.auth(&self.info.authentication, &credentials).await?;
conn.auth(&self.info.authentication, credentials).await?;
}
Ok(conn)
}

View File

@@ -161,7 +161,7 @@ impl NetworkStream {
let domain = DNSNameRef::try_from_ascii_str(tls_parameters.domain())
.map_err(error::connection)?;
let stream = StreamOwned::new(ClientSession::new(&connector, domain), tcp_stream);
let stream = StreamOwned::new(ClientSession::new(connector, domain), tcp_stream);
InnerNetworkStream::RustlsTls(stream)
}

View File

@@ -225,7 +225,7 @@ impl SmtpClient {
}
if let Some(credentials) = &self.info.credentials {
conn.auth(&self.info.authentication, &credentials)?;
conn.auth(&self.info.authentication, credentials)?;
}
Ok(conn)
}