From 6164f8314730c1736e296e19fb94260f7eefe227 Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Fri, 21 Jun 2019 23:32:00 +1000 Subject: [PATCH] Fix compiler errors in wasapi backend after testing on windows --- src/wasapi/device.rs | 6 +++--- src/wasapi/mod.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wasapi/device.rs b/src/wasapi/device.rs index 2cac6aa..a70b591 100644 --- a/src/wasapi/device.rs +++ b/src/wasapi/device.rs @@ -409,7 +409,7 @@ impl Device { // Retrieve the `IAudioClient`. let lock = match self.ensure_future_audio_client() { Ok(lock) => lock, - Err(e) if e.raw_os_error() == Some(AUDCLNT_E_DEVICE_INVALIDATED) => { + Err(ref e) if e.raw_os_error() == Some(AUDCLNT_E_DEVICE_INVALIDATED) => { return Err(SupportedFormatsError::DeviceNotAvailable) } Err(e) => { @@ -748,11 +748,11 @@ impl Devices { // can fail if the parameter is null, which should never happen check_result_backend_specific((*collection).GetCount(&mut count))?; - Devices { + Ok(Devices { collection: collection, total_count: count, next_item: 0, - } + }) } } } diff --git a/src/wasapi/mod.rs b/src/wasapi/mod.rs index 7fe9de8..6fb462b 100644 --- a/src/wasapi/mod.rs +++ b/src/wasapi/mod.rs @@ -21,10 +21,10 @@ fn check_result(result: HRESULT) -> Result<(), IoError> { fn check_result_backend_specific(result: HRESULT) -> Result<(), BackendSpecificError> { match check_result(result) { - Ok(()) => Ok(()) + Ok(()) => Ok(()), Err(err) => { let description = format!("{}", err); - return BackendSpecificError { description } + return Err(BackendSpecificError { description }); } } }