Fix code style

tungstenite-0.20
Sebastian Dröge 1 year ago
parent b3376f3dd9
commit 04a9a07a7d
  1. 16
      src/lib.rs

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

Loading…
Cancel
Save