From 020bd0f4ae9548151461f6db1b3febb6b91b1c7c Mon Sep 17 00:00:00 2001 From: Yury Date: Sun, 12 Jan 2025 15:56:50 +0300 Subject: [PATCH] reuse os::result_init --- cidre/src/core_audio/hardware.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cidre/src/core_audio/hardware.rs b/cidre/src/core_audio/hardware.rs index d245fc5c..ebe7cd79 100644 --- a/cidre/src/core_audio/hardware.rs +++ b/cidre/src/core_audio/hardware.rs @@ -1263,11 +1263,7 @@ pub mod aggregate_device_keys { impl AggregateDevice { pub fn with_desc(desc: &cf::DictionaryOf) -> os::Result { - let mut res = std::mem::MaybeUninit::uninit(); - unsafe { - AudioHardwareCreateAggregateDevice(desc, res.as_mut_ptr()).result()?; - Ok(res.assume_init()) - } + os::result_init(|ptr| unsafe { AudioHardwareCreateAggregateDevice(desc, ptr) }) } pub fn composition(&self) -> os::Result>> {