File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -286,15 +286,20 @@ fn retrieve_result(
286286 operation. GetActivateResult ( & mut result, & mut interface) ?;
287287 }
288288 result. ok ( ) ?;
289- Ok ( interface. unwrap ( ) )
289+ interface. ok_or_else ( || {
290+ windows:: core:: Error :: new (
291+ Audio :: AUDCLNT_E_DEVICE_INVALIDATED ,
292+ "audio interface could not be retrieved during activation" ,
293+ )
294+ } )
290295}
291296
292297impl Audio :: IActivateAudioInterfaceCompletionHandler_Impl for CompletionHandler_Impl {
293298 fn ActivateCompleted (
294299 & self ,
295300 operation : windows:: core:: Ref < Audio :: IActivateAudioInterfaceAsyncOperation > ,
296301 ) -> windows:: core:: Result < ( ) > {
297- let result = retrieve_result ( operation. ok ( ) ? ) ;
302+ let result = operation. ok ( ) . and_then ( retrieve_result ) ;
298303 let _ = self . 0 . send ( result) ;
299304 Ok ( ( ) )
300305 }
You can’t perform that action at this time.
0 commit comments