Fix code style

This commit is contained in:
Sebastian Dröge 2023-06-02 11:14:56 +03:00 committed by Sebastian Dröge
parent ab9ea1c9f6
commit 8eba873db3
1 changed files with 9 additions and 7 deletions

View File

@ -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>> {