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>> {