diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b05339..6c47181 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,12 +78,7 @@ jobs: clippy_check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - components: clippy - override: true + - uses: actions/checkout@v3 - uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/benches/transport_smtp.rs b/benches/transport_smtp.rs index d92eccd..5d30118 100644 --- a/benches/transport_smtp.rs +++ b/benches/transport_smtp.rs @@ -24,7 +24,7 @@ fn bench_simple_send(c: &mut Criterion) { vec![EmailAddress::new("root@localhost".to_string()).unwrap()], ) .unwrap(), - "id".to_string(), + "id", "From: user@localhost\r\n\ Content-Type: text/plain\r\n\ \r\n\ @@ -55,7 +55,7 @@ fn bench_reuse_send(c: &mut Criterion) { vec![EmailAddress::new("root@localhost".to_string()).unwrap()], ) .unwrap(), - "id".to_string(), + "id", "From: user@localhost\r\n\ Content-Type: text/plain\r\n\ \r\n\ diff --git a/examples/smtp.rs b/examples/smtp.rs index 3c56528..f2795b6 100644 --- a/examples/smtp.rs +++ b/examples/smtp.rs @@ -9,7 +9,7 @@ fn main() { vec![EmailAddress::new("root@localhost".to_string()).unwrap()], ) .unwrap(), - "id".to_string(), + "id", "Hello ß☺ example".to_string().into_bytes(), ); diff --git a/examples/smtp_gmail.rs b/examples/smtp_gmail.rs index b698dd9..f77d1e8 100644 --- a/examples/smtp_gmail.rs +++ b/examples/smtp_gmail.rs @@ -9,7 +9,7 @@ fn main() { vec![EmailAddress::new("to@example.com".to_string()).unwrap()], ) .unwrap(), - "id".to_string(), + "id", "Hello example".to_string().into_bytes(), ); diff --git a/src/smtp/client/codec.rs b/src/smtp/client/codec.rs index 23f25b5..e9aa973 100644 --- a/src/smtp/client/codec.rs +++ b/src/smtp/client/codec.rs @@ -25,6 +25,7 @@ impl ClientCodec { impl ClientCodec { /// Adds transparency /// TODO: replace CR and LF by CRLF + #[allow(clippy::bool_to_int_with_if)] pub async fn encode(&mut self, frame: &[u8], mut buf: W) -> io::Result<()> { match frame.len() { 0 => { diff --git a/src/smtp/commands.rs b/src/smtp/commands.rs index f5eefaa..ab52b0c 100644 --- a/src/smtp/commands.rs +++ b/src/smtp/commands.rs @@ -312,7 +312,7 @@ impl AuthCommand { .ok_or(Error::ResponseParsing("Could not read auth challenge"))?; debug!("auth encoded challenge: {}", encoded_challenge); - let decoded_challenge = String::from_utf8(base64::decode(&encoded_challenge)?)?; + let decoded_challenge = String::from_utf8(base64::decode(encoded_challenge)?)?; debug!("auth decoded challenge: {}", decoded_challenge); let response = Some(mechanism.response(&credentials, Some(decoded_challenge.as_ref()))?); @@ -383,7 +383,7 @@ mod test { "RCPT TO:\r\n" ); assert_eq!( - format!("{}", RcptCommand::new(email.clone(), vec![rcpt_parameter])), + format!("{}", RcptCommand::new(email, vec![rcpt_parameter])), "RCPT TO: TEST=value\r\n" ); assert_eq!(format!("{}", QuitCommand), "QUIT\r\n"); @@ -414,7 +414,7 @@ mod test { assert_eq!( format!( "{}", - AuthCommand::new(Mechanism::Login, credentials.clone(), None).unwrap() + AuthCommand::new(Mechanism::Login, credentials, None).unwrap() ), "AUTH LOGIN\r\n" ); diff --git a/tests/transport_file.rs b/tests/transport_file.rs index ce0efac..1e7d25f 100644 --- a/tests/transport_file.rs +++ b/tests/transport_file.rs @@ -18,7 +18,7 @@ mod test { vec![EmailAddress::new("root@localhost".to_string()).unwrap()], ) .unwrap(), - "id".to_string(), + "id", "Hello ß☺ example".to_string().into_bytes(), ); let message_id = email.message_id().to_string(); diff --git a/tests/transport_sendmail.rs b/tests/transport_sendmail.rs index 87321d0..88d4c69 100644 --- a/tests/transport_sendmail.rs +++ b/tests/transport_sendmail.rs @@ -14,7 +14,7 @@ mod test { vec![EmailAddress::new("root@localhost".to_string()).unwrap()], ) .unwrap(), - "id".to_string(), + "id", "Hello ß☺ example".to_string().into_bytes(), ); diff --git a/tests/transport_stub.rs b/tests/transport_stub.rs index 6aa0c1c..db1cb09 100644 --- a/tests/transport_stub.rs +++ b/tests/transport_stub.rs @@ -13,7 +13,7 @@ mod test { vec![EmailAddress::new("root@localhost".to_string()).unwrap()], ) .unwrap(), - "id".to_string(), + "id", "Hello ß☺ example".to_string().into_bytes(), ); let email_ko = SendableEmail::new( @@ -22,7 +22,7 @@ mod test { vec![EmailAddress::new("root@localhost".to_string()).unwrap()], ) .unwrap(), - "id".to_string(), + "id", "Hello ß☺ example".to_string().into_bytes(), );