Skip to content

Commit 2202cfc

Browse files
committed
Fix try/dyn deprecation warnings
1 parent 741099d commit 2202cfc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/audio_unit/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ struct InputCallback {
8989

9090

9191
macro_rules! try_os_status {
92-
($expr:expr) => (try!(Error::from_os_status($expr)))
92+
($expr:expr) => (Error::from_os_status($expr)?)
9393
}
9494

9595

@@ -290,7 +290,7 @@ impl AudioUnit {
290290
/// Return the current Stream Format for the AudioUnit.
291291
pub fn stream_format(&self, scope: Scope) -> Result<StreamFormat, Error> {
292292
let id = sys::kAudioUnitProperty_StreamFormat;
293-
let asbd = try!(self.get_property(id, scope, Element::Output));
293+
let asbd = self.get_property(id, scope, Element::Output)?;
294294
StreamFormat::from_asbd(asbd)
295295
}
296296

src/audio_unit/render_callback.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub use self::data::Data;
1414
///
1515
/// This allows the user to provide a custom, more rust-esque callback function type that takes
1616
/// greater advantage of rust's type safety.
17-
pub type InputProcFn = FnMut(*mut sys::AudioUnitRenderActionFlags,
17+
pub type InputProcFn = dyn FnMut(*mut sys::AudioUnitRenderActionFlags,
1818
*const sys::AudioTimeStamp,
1919
sys::UInt32,
2020
sys::UInt32,
@@ -398,7 +398,7 @@ impl AudioUnit {
398398
// First, we'll retrieve the stream format so that we can ensure that the given callback
399399
// format matches the audio unit's format.
400400
let id = sys::kAudioUnitProperty_StreamFormat;
401-
let asbd = try!(self.get_property(id, Scope::Input, Element::Output));
401+
let asbd = self.get_property(id, Scope::Input, Element::Output)?;
402402
let stream_format = super::StreamFormat::from_asbd(asbd)?;
403403

404404
// If the stream format does not match, return an error indicating this.

0 commit comments

Comments
 (0)