Browse Source

make clippy happy

pull/221/head
ssrlive 11 months ago
parent
commit
f6562742cc
  1. 2
      src/http.rs
  2. 2
      src/no_proxy.rs
  3. 2
      src/proxy_handler.rs
  4. 2
      src/socks.rs

2
src/http.rs

@ -367,7 +367,7 @@ impl ProxyHandler for HttpConnection {
buffer.drain(0..size); 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 { let buffer = if dir == OutgoingDirection::ToServer {
&mut self.server_outbuf &mut self.server_outbuf
} else { } else {

2
src/no_proxy.rs

@ -49,7 +49,7 @@ impl ProxyHandler for NoProxyHandler {
buffer.drain(0..size); buffer.drain(0..size);
} }
fn peek_data(&mut self, dir: OutgoingDirection) -> OutgoingDataEvent { fn peek_data(&mut self, dir: OutgoingDirection) -> OutgoingDataEvent<'_> {
let buffer = match dir { let buffer = match dir {
OutgoingDirection::ToServer => &mut self.server_outbuf, OutgoingDirection::ToServer => &mut self.server_outbuf,
OutgoingDirection::ToClient => &mut self.client_outbuf, OutgoingDirection::ToClient => &mut self.client_outbuf,

2
src/proxy_handler.rs

@ -12,7 +12,7 @@ pub(crate) trait ProxyHandler: Send + Sync {
fn get_domain_name(&self) -> Option<String>; fn get_domain_name(&self) -> Option<String>;
async fn push_data(&mut self, event: IncomingDataEvent<'_>) -> std::io::Result<()>; async fn push_data(&mut self, event: IncomingDataEvent<'_>) -> std::io::Result<()>;
fn consume_data(&mut self, dir: OutgoingDirection, size: usize); 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; fn connection_established(&self) -> bool;
#[allow(dead_code)] #[allow(dead_code)]
fn data_len(&self, dir: OutgoingDirection) -> usize; fn data_len(&self, dir: OutgoingDirection) -> usize;

2
src/socks.rs

@ -297,7 +297,7 @@ impl ProxyHandler for SocksProxyImpl {
buffer.drain(0..size); buffer.drain(0..size);
} }
fn peek_data(&mut self, dir: OutgoingDirection) -> OutgoingDataEvent { fn peek_data(&mut self, dir: OutgoingDirection) -> OutgoingDataEvent<'_> {
let buffer = match dir { let buffer = match dir {
OutgoingDirection::ToServer => &mut self.server_outbuf, OutgoingDirection::ToServer => &mut self.server_outbuf,
OutgoingDirection::ToClient => &mut self.client_outbuf, OutgoingDirection::ToClient => &mut self.client_outbuf,

Loading…
Cancel
Save