From f6562742cccbf44d2d1b162b67758bb15f8e7f9d Mon Sep 17 00:00:00 2001 From: ssrlive <30760636+ssrlive@users.noreply.github.com> Date: Mon, 7 Jul 2025 13:58:54 +0800 Subject: [PATCH] make clippy happy --- src/http.rs | 2 +- src/no_proxy.rs | 2 +- src/proxy_handler.rs | 2 +- src/socks.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/http.rs b/src/http.rs index 2b08ed1..7530993 100644 --- a/src/http.rs +++ b/src/http.rs @@ -367,7 +367,7 @@ impl ProxyHandler for HttpConnection { buffer.drain(0..size); } - fn peek_data(&mut self, dir: OutgoingDirection) -> OutgoingDataEvent { + fn peek_data(&mut self, dir: OutgoingDirection) -> OutgoingDataEvent<'_> { let buffer = if dir == OutgoingDirection::ToServer { &mut self.server_outbuf } else { diff --git a/src/no_proxy.rs b/src/no_proxy.rs index d3c00e0..a4cd6ac 100644 --- a/src/no_proxy.rs +++ b/src/no_proxy.rs @@ -49,7 +49,7 @@ impl ProxyHandler for NoProxyHandler { buffer.drain(0..size); } - fn peek_data(&mut self, dir: OutgoingDirection) -> OutgoingDataEvent { + fn peek_data(&mut self, dir: OutgoingDirection) -> OutgoingDataEvent<'_> { let buffer = match dir { OutgoingDirection::ToServer => &mut self.server_outbuf, OutgoingDirection::ToClient => &mut self.client_outbuf, diff --git a/src/proxy_handler.rs b/src/proxy_handler.rs index 74ccfdb..54bfca4 100644 --- a/src/proxy_handler.rs +++ b/src/proxy_handler.rs @@ -12,7 +12,7 @@ pub(crate) trait ProxyHandler: Send + Sync { fn get_domain_name(&self) -> Option; async fn push_data(&mut self, event: IncomingDataEvent<'_>) -> std::io::Result<()>; fn consume_data(&mut self, dir: OutgoingDirection, size: usize); - fn peek_data(&mut self, dir: OutgoingDirection) -> OutgoingDataEvent; + fn peek_data(&mut self, dir: OutgoingDirection) -> OutgoingDataEvent<'_>; fn connection_established(&self) -> bool; #[allow(dead_code)] fn data_len(&self, dir: OutgoingDirection) -> usize; diff --git a/src/socks.rs b/src/socks.rs index e2265ba..6e2764a 100644 --- a/src/socks.rs +++ b/src/socks.rs @@ -297,7 +297,7 @@ impl ProxyHandler for SocksProxyImpl { buffer.drain(0..size); } - fn peek_data(&mut self, dir: OutgoingDirection) -> OutgoingDataEvent { + fn peek_data(&mut self, dir: OutgoingDirection) -> OutgoingDataEvent<'_> { let buffer = match dir { OutgoingDirection::ToServer => &mut self.server_outbuf, OutgoingDirection::ToClient => &mut self.client_outbuf,