Respond to code review tidbits.
This commit is contained in:
parent
0af6a1c466
commit
97af8b77ae
1 changed files with 3 additions and 3 deletions
|
|
@ -47,10 +47,10 @@ impl AudioObjectPropertyListener {
|
||||||
/// Use this method if you need to explicitly handle failure to remove
|
/// Use this method if you need to explicitly handle failure to remove
|
||||||
/// the property listener.
|
/// the property listener.
|
||||||
pub fn remove(mut self) -> Result<(), BuildStreamError> {
|
pub fn remove(mut self) -> Result<(), BuildStreamError> {
|
||||||
self._remove()
|
self.remove_inner()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn _remove(&mut self) -> Result<(), BuildStreamError> {
|
fn remove_inner(&mut self) -> Result<(), BuildStreamError> {
|
||||||
unsafe {
|
unsafe {
|
||||||
coreaudio::Error::from_os_status(AudioObjectRemovePropertyListener(
|
coreaudio::Error::from_os_status(AudioObjectRemovePropertyListener(
|
||||||
self.audio_object_id,
|
self.audio_object_id,
|
||||||
|
|
@ -67,7 +67,7 @@ impl AudioObjectPropertyListener {
|
||||||
impl Drop for AudioObjectPropertyListener {
|
impl Drop for AudioObjectPropertyListener {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
if !self.removed {
|
if !self.removed {
|
||||||
self._remove().ok();
|
let _ = self.remove_inner();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue