Browse Source

Apply clippy fixes

pull/21/head
B. Blechschmidt 3 years ago
parent
commit
7818829760
  1. 8
      src/http.rs
  2. 8
      src/socks5.rs

8
src/http.rs

@ -164,14 +164,14 @@ impl TcpProxy for HttpConnection {
fn have_data(&mut self, dir: Direction) -> bool {
match dir {
Direction::Incoming(incoming) => match incoming {
IncomingDirection::FromServer => self.server_inbuf.len() > 0,
IncomingDirection::FromServer => !self.server_inbuf.is_empty(),
IncomingDirection::FromClient => {
self.client_inbuf.len() > 0 || self.data_buf.len() > 0
!self.client_inbuf.is_empty() || !self.data_buf.is_empty()
}
},
Direction::Outgoing(outgoing) => match outgoing {
OutgoingDirection::ToServer => self.server_outbuf.len() > 0,
OutgoingDirection::ToClient => self.client_outbuf.len() > 0,
OutgoingDirection::ToServer => !self.server_outbuf.is_empty(),
OutgoingDirection::ToClient => !self.client_outbuf.is_empty(),
},
}
}

8
src/socks5.rs

@ -372,14 +372,14 @@ impl TcpProxy for SocksConnection {
fn have_data(&mut self, dir: Direction) -> bool {
match dir {
Direction::Incoming(incoming) => match incoming {
IncomingDirection::FromServer => self.server_inbuf.len() > 0,
IncomingDirection::FromServer => !self.server_inbuf.is_empty(),
IncomingDirection::FromClient => {
self.client_inbuf.len() > 0 || self.data_buf.len() > 0
!self.client_inbuf.is_empty() || !self.data_buf.is_empty()
}
},
Direction::Outgoing(outgoing) => match outgoing {
OutgoingDirection::ToServer => self.server_outbuf.len() > 0,
OutgoingDirection::ToClient => self.client_outbuf.len() > 0,
OutgoingDirection::ToServer => !self.server_outbuf.is_empty(),
OutgoingDirection::ToClient => !self.client_outbuf.is_empty(),
},
}
}

Loading…
Cancel
Save