Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
voidc committed Aug 26, 2020
1 parent 3ce8d5b commit 2a93c4d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ impl RoundHandler {
}

pub(crate) async fn handle_data(&mut self, tunnel_id: TunnelId, data: Bytes) {
if let None = self.try_handle_data(tunnel_id, data).await {
if self.try_handle_data(tunnel_id, data).await.is_none() {
warn!("RoundHandler: handle_data failed");
let _ = self
.events
Expand All @@ -320,7 +320,7 @@ impl RoundHandler {
}

async fn try_handle_data(&mut self, tunnel_id: TunnelId, mut data: Bytes) -> Option<()> {
while data.len() > 0 {
while !data.is_empty() {
let part = data.split_to(cmp::min(protocol::MAX_DATA_SIZE, data.len()));
self.tunnels
.lock()
Expand All @@ -333,7 +333,7 @@ impl RoundHandler {
}

pub(crate) async fn handle_destroy(&mut self, tunnel_id: TunnelId) {
if let None = self.try_handle_destroy(tunnel_id).await {
if self.try_handle_destroy(tunnel_id).await.is_none() {
warn!("RoundHandler: handle_destroy failed");
let _ = self
.events
Expand All @@ -355,7 +355,7 @@ impl RoundHandler {
}

pub(crate) async fn handle_cover(&mut self, size: u16) {
if let None = self.try_handle_cover(size).await {
if self.try_handle_cover(size).await.is_none() {
warn!("RoundHandler: handle_cover failed");
let _ = self
.events
Expand Down

0 comments on commit 2a93c4d

Please sign in to comment.