Skip to content

Commit 7a86eff

Browse files
committed
Use WsError for the Sink implementation
1 parent bb05522 commit 7a86eff

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/test.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -623,31 +623,31 @@ impl fmt::Debug for WsClient {
623623

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

628628
fn poll_ready(
629629
self: Pin<&mut Self>,
630630
context: &mut Context<'_>,
631631
) -> Poll<Result<(), Self::Error>> {
632-
self.pinned_tx().poll_ready(context).map_err(|_| ())
632+
self.pinned_tx().poll_ready(context).map_err(WsError::new)
633633
}
634634

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

639639
fn poll_flush(
640640
self: Pin<&mut Self>,
641641
context: &mut Context<'_>,
642642
) -> Poll<Result<(), Self::Error>> {
643-
self.pinned_tx().poll_flush(context).map_err(|_| ())
643+
self.pinned_tx().poll_flush(context).map_err(WsError::new)
644644
}
645645

646646
fn poll_close(
647647
self: Pin<&mut Self>,
648648
context: &mut Context<'_>,
649649
) -> Poll<Result<(), Self::Error>> {
650-
self.pinned_tx().poll_close(context).map_err(|_| ())
650+
self.pinned_tx().poll_close(context).map_err(WsError::new)
651651
}
652652
}
653653

0 commit comments

Comments
 (0)