Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
sdroege committed Jun 2, 2023
1 parent 0099fa8 commit 14d7165
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +388,15 @@ where
}

fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
(*self).with_context(Some((ContextWaker::Write, cx)), |s| cvt(s.flush())).map(|r| {
// WebSocket connection has just been closed. Flushing completed, not an error.
match r {
Err(WsError::ConnectionClosed) => Ok(()),
other => other,
}
})
(*self)
.with_context(Some((ContextWaker::Write, cx)), |s| cvt(s.flush()))
.map(|r| {
// WebSocket connection has just been closed. Flushing completed, not an error.
match r {
Err(WsError::ConnectionClosed) => Ok(()),
other => other,
}
})
}

fn poll_close(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
Expand Down

0 comments on commit 14d7165

Please sign in to comment.