File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -329,7 +329,7 @@ where
329
329
{
330
330
pub ( crate ) fn new ( recv : C :: RecvStream ) -> ( Self , UnwrapToPending < RpcServerError < C > > ) {
331
331
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) ) ;
333
333
( Self ( recv, Some ( error_send) , PhantomData ) , error_recv)
334
334
}
335
335
}
@@ -449,12 +449,13 @@ impl<C: ConnectionErrors> fmt::Display for RpcServerError<C> {
449
449
impl < C : ConnectionErrors > error:: Error for RpcServerError < C > { }
450
450
451
451
/// 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 > > ) ;
453
453
454
454
impl < T > Future for UnwrapToPending < T > {
455
455
type Output = T ;
456
456
457
457
fn poll ( mut self : Pin < & mut Self > , cx : & mut task:: Context < ' _ > ) -> Poll < Self :: Output > {
458
+ // todo: use is_terminated from tokio 1.44 here to avoid the fused wrapper
458
459
match Pin :: new ( & mut self . 0 ) . poll ( cx) {
459
460
Poll :: Ready ( Ok ( x) ) => Poll :: Ready ( x) ,
460
461
Poll :: Ready ( Err ( _) ) => Poll :: Pending ,
You can’t perform that action at this time.
0 commit comments