Skip to content

Commit

Permalink
reuse os::result_init
Browse files Browse the repository at this point in the history
  • Loading branch information
yury committed Jan 12, 2025
1 parent cfdddde commit 020bd0f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions cidre/src/core_audio/hardware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1263,11 +1263,7 @@ pub mod aggregate_device_keys {

impl AggregateDevice {
pub fn with_desc(desc: &cf::DictionaryOf<cf::String, cf::Type>) -> os::Result<Self> {
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<arc::R<cf::DictionaryOf<cf::String, cf::Type>>> {
Expand Down

0 comments on commit 020bd0f

Please sign in to comment.