@@ -52,7 +52,7 @@ enum LoopTask {
5252 oneshot:: Sender < NyquestResult < super :: CurlAsyncResponse > > ,
5353 ) ,
5454 UnpauseRecvHandle ( usize ) ,
55- UnpauseSendHandle ( usize ) ,
55+ _UnpauseSendHandle ( usize ) ,
5656 DropHandle ( usize ) ,
5757 Shutdown ,
5858}
@@ -68,11 +68,8 @@ impl From<LoopTask> for LoopTaskWrapper {
6868impl Drop for LoopTaskWrapper {
6969 fn drop ( & mut self ) {
7070 let task = unsafe { ManuallyDrop :: take ( & mut self . 0 ) } ;
71- match task {
72- LoopTask :: ConstructHandle ( handle, tx) => {
73- tx. send ( Err ( handle) ) . ok ( ) ;
74- }
75- _ => { }
71+ if let LoopTask :: ConstructHandle ( handle, tx) = task {
72+ tx. send ( Err ( handle) ) . ok ( ) ;
7673 }
7774 }
7875}
@@ -97,14 +94,15 @@ impl RequestHandle {
9794 . await ?;
9895
9996 let ( tx, rx) = oneshot:: channel ( ) ;
100- self . manager
97+ let send_task_res = self
98+ . manager
10199 . clone ( )
102100 . dispatch_task ( LoopTask :: QueryHandleResponse (
103101 self . shared_context . id ,
104102 self ,
105103 tx,
106104 ) ) ;
107- let Ok ( res) = rx. await else {
105+ let ( Ok ( _ ) , Ok ( res) ) = ( send_task_res , rx. await ) else {
108106 return Err (
109107 io:: Error :: new ( io:: ErrorKind :: ConnectionAborted , "handle not found" ) . into ( ) ,
110108 ) ;
@@ -141,7 +139,8 @@ impl RequestHandle {
141139 return Poll :: Ready ( res. map ( |( ) | None ) ) ;
142140 } ;
143141 self . manager
144- . dispatch_task ( LoopTask :: UnpauseRecvHandle ( self . shared_context . id ) ) ;
142+ . dispatch_task ( LoopTask :: UnpauseRecvHandle ( self . shared_context . id ) )
143+ . ok ( ) ;
145144 self . shared_context . waker . register ( cx. waker ( ) ) ;
146145 Poll :: Pending
147146 }
@@ -150,7 +149,8 @@ impl RequestHandle {
150149impl Drop for RequestHandle {
151150 fn drop ( & mut self ) {
152151 self . manager
153- . dispatch_task ( LoopTask :: DropHandle ( self . shared_context . id ) ) ;
152+ . dispatch_task ( LoopTask :: DropHandle ( self . shared_context . id ) )
153+ . ok ( ) ;
154154 }
155155}
156156
@@ -270,7 +270,7 @@ impl LoopManager {
270270impl Drop for LoopManager {
271271 fn drop ( & mut self ) {
272272 if let Some ( inner) = self . inner . get_mut ( ) {
273- inner. dispatch_task ( LoopTask :: Shutdown ) ;
273+ inner. dispatch_task ( LoopTask :: Shutdown ) . ok ( ) ;
274274 }
275275 }
276276}
@@ -364,7 +364,7 @@ fn run_loop(multl_waker_tx: oneshot::Sender<LoopManagerShared>) {
364364 handle. unpause_read ( ) . ok ( ) ;
365365 }
366366 }
367- LoopTask :: UnpauseSendHandle ( id) => {
367+ LoopTask :: _UnpauseSendHandle ( id) => {
368368 if let Some ( ( handle, _) ) = slab. get ( id) {
369369 // Ignore the error. Also see
370370 handle. unpause_write ( ) . ok ( ) ;
0 commit comments