Skip to content

Commit

Permalink
Use WsError for the Sink implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
FSMaxB committed Oct 10, 2021
1 parent f2b934f commit e2a07bf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,31 +623,31 @@ impl fmt::Debug for WsClient {

#[cfg(feature = "websocket")]
impl Sink<crate::ws::Message> for WsClient {
type Error = ();
type Error = WsError;

fn poll_ready(
self: Pin<&mut Self>,
context: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>> {
self.pinned_tx().poll_ready(context).map_err(|_| ())
self.pinned_tx().poll_ready(context).map_err(WsError::new)
}

fn start_send(self: Pin<&mut Self>, message: Message) -> Result<(), Self::Error> {
self.pinned_tx().start_send(message).map_err(|_| ())
self.pinned_tx().start_send(message).map_err(WsError::new)
}

fn poll_flush(
self: Pin<&mut Self>,
context: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>> {
self.pinned_tx().poll_flush(context).map_err(|_| ())
self.pinned_tx().poll_flush(context).map_err(WsError::new)
}

fn poll_close(
self: Pin<&mut Self>,
context: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>> {
self.pinned_tx().poll_close(context).map_err(|_| ())
self.pinned_tx().poll_close(context).map_err(WsError::new)
}
}

Expand Down

0 comments on commit e2a07bf

Please sign in to comment.