From 7eae39a59f6404094a983706cdd46e7acd43abd1 Mon Sep 17 00:00:00 2001 From: Zhang Jingqiang Date: Wed, 15 May 2024 21:24:07 +0800 Subject: [PATCH] fix clippy warning --- g3proxy/src/inspect/smtp/initiation.rs | 7 +------ lib/g3-io-ext/src/udp/ext/unix.rs | 2 -- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/g3proxy/src/inspect/smtp/initiation.rs b/g3proxy/src/inspect/smtp/initiation.rs index c74c8ee69..e1dce4db3 100644 --- a/g3proxy/src/inspect/smtp/initiation.rs +++ b/g3proxy/src/inspect/smtp/initiation.rs @@ -114,12 +114,7 @@ impl Initiation { .await?; if rsp.code() == ReplyCode::OK { - if rsp.is_first_line() { - clt_w - .write_all(line) - .await - .map_err(ServerTaskError::ClientTcpWriteFailed)?; - } else if self.allow_extension(msg) { + if rsp.is_first_line() || self.allow_extension(msg) { clt_w .write_all(line) .await diff --git a/lib/g3-io-ext/src/udp/ext/unix.rs b/lib/g3-io-ext/src/udp/ext/unix.rs index 6d2acc7ac..42d2495fd 100644 --- a/lib/g3-io-ext/src/udp/ext/unix.rs +++ b/lib/g3-io-ext/src/udp/ext/unix.rs @@ -455,7 +455,6 @@ mod tests { assert_eq!(hdr_v[1].n_recv, msg_2.len()); assert_eq!(hdr_v[1].addr(), Some(c_addr)); - drop(hdr_v); assert_eq!(&recv_msg1[..msg_1.len()], msg_1); assert_eq!(&recv_msg2[..msg_2.len()], msg_2); } @@ -499,7 +498,6 @@ mod tests { assert_eq!(hdr_v[0].n_recv, msg_1.len()); assert_eq!(hdr_v[0].addr(), Some(c_addr)); - drop(hdr_v); assert_eq!(&recv_msg1[..msg_1.len()], msg_1); let mut recv_msg2 = [0u8; 16];