Skip to content

Commit 01588c0

Browse files
committed
fuse the oneshot channel
1 parent 95ce856 commit 01588c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ where
329329
{
330330
pub(crate) fn new(recv: C::RecvStream) -> (Self, UnwrapToPending<RpcServerError<C>>) {
331331
let (error_send, error_recv) = oneshot::channel();
332-
let error_recv = UnwrapToPending(error_recv);
332+
let error_recv = UnwrapToPending(futures_lite::future::fuse(error_recv));
333333
(Self(recv, Some(error_send), PhantomData), error_recv)
334334
}
335335
}
@@ -449,7 +449,7 @@ impl<C: ConnectionErrors> fmt::Display for RpcServerError<C> {
449449
impl<C: ConnectionErrors> error::Error for RpcServerError<C> {}
450450

451451
/// Take an oneshot receiver and just return Pending the underlying future returns `Err(oneshot::Canceled)`
452-
pub(crate) struct UnwrapToPending<T>(oneshot::Receiver<T>);
452+
pub(crate) struct UnwrapToPending<T>(futures_lite::future::Fuse<oneshot::Receiver<T>>);
453453

454454
impl<T> Future for UnwrapToPending<T> {
455455
type Output = T;

0 commit comments

Comments
 (0)