fn com<F>(mut f: F, method: &str) -> Result<(), DialogError>
where
    F: FnMut() -> HRESULT,
{
    let hresult = f();
    if !SUCCEEDED(hresult) {
        Err(DialogError::HResultFailed {
            hresult,
            error_method: method.to_string() })
    } else {
        Ok(())
    }
}
// This wrapper method makes working with COM methods much simpler by
// returning Err if the HRESULT for a call does not return success.
This wrapper method makes working with COM methods much simpler by
returning Err if the HRESULT for a call does not return success.
This wrapper method makes working with COM methods much simpler by returning Err if the HRESULT for a call does not return success .
fn com<F>(mut f: F, method: &str) -> Result<(), DialogError>
where
    F: FnMut() -> HRESULT,
{
    let hresult = f();
    if !SUCCEEDED(hresult) {
        Err(DialogError::HResultFailed {
            hresult,
            error_method: method.to_string() })
    } else {
        Ok(())
    }
}
fn com < F > ( mut f : F , method : & str ) -> Result < ( ) , DialogError > where F : FnMut ( ) -> HRESULT , { let hresult = f ( ) ; if ! SUCCEEDED ( hresult ) { Err ( DialogError :: HResultFailed { hresult , error_method : method . to_string ( ) } ) } else { Ok ( ( ) ) } }
This wrapper method makes working with COM methods much simpler by
returning Err if the HRESULT for a call does not return success.
This wrapper method makes working with COM methods much simpler by returning Err if the HRESULT for a call does not return success .
f
F
method
&str