@@ -149,8 +149,7 @@ impl Stream {
149149 fn push_command ( & self , command : Command ) -> Result < ( ) , SendError < Command > > {
150150 self . commands . send ( command) ?;
151151 unsafe {
152- let result = Threading :: SetEvent ( self . pending_scheduled_event ) ;
153- assert_ne ! ( result, false ) ;
152+ Threading :: SetEvent ( self . pending_scheduled_event ) . unwrap ( ) ;
154153 }
155154 Ok ( ( ) )
156155 }
@@ -162,7 +161,7 @@ impl Drop for Stream {
162161 if self . push_command ( Command :: Terminate ) . is_ok ( ) {
163162 self . thread . take ( ) . unwrap ( ) . join ( ) . unwrap ( ) ;
164163 unsafe {
165- Foundation :: CloseHandle ( self . pending_scheduled_event ) ;
164+ let _ = Foundation :: CloseHandle ( self . pending_scheduled_event ) ;
166165 }
167166 }
168167 }
@@ -185,7 +184,7 @@ impl Drop for StreamInner {
185184 #[ inline]
186185 fn drop ( & mut self ) {
187186 unsafe {
188- Foundation :: CloseHandle ( self . event ) ;
187+ let _ = Foundation :: CloseHandle ( self . event ) ;
189188 }
190189 }
191190}
@@ -243,8 +242,11 @@ fn wait_for_handle_signal(handles: &[Foundation::HANDLE]) -> Result<usize, Backe
243242 )
244243 } ;
245244 if result == Foundation :: WAIT_FAILED {
246- let err = unsafe { Foundation :: GetLastError ( ) } ;
247- let description = format ! ( "`WaitForMultipleObjectsEx failed: {}" , err. 0 ) ;
245+ let err = match unsafe { Foundation :: GetLastError ( ) } {
246+ Ok ( ( ) ) => windows:: core:: Error :: OK ,
247+ Err ( err) => err,
248+ } ;
249+ let description = format ! ( "`WaitForMultipleObjectsEx failed: {}" , err) ;
248250 let err = BackendSpecificError { description } ;
249251 return Err ( err) ;
250252 }
0 commit comments