Skip to content

Commit 53566ef

Browse files
author
Andres de Lago Gomez
committed
Fix missing error impls and format
1 parent 75a537d commit 53566ef

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

examples/sine_advanced.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ extern crate coreaudio;
55

66
use coreaudio::audio_unit::audio_format::LinearPcmFlags;
77
use coreaudio::audio_unit::macos_helpers::{
8-
audio_unit_from_device_id, find_matching_physical_format, get_default_device_id, get_hogging_pid,
9-
get_supported_physical_stream_formats, set_device_physical_stream_format,
8+
audio_unit_from_device_id, find_matching_physical_format, get_default_device_id,
9+
get_hogging_pid, get_supported_physical_stream_formats, set_device_physical_stream_format,
1010
set_device_sample_rate, toggle_hog_mode, AliveListener, RateListener,
1111
};
1212
use coreaudio::audio_unit::render_callback::{self, data};

src/error.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ pub mod audio {
4141
}
4242
}
4343

44+
impl std::error::Error for Error {}
45+
4446
impl ::std::fmt::Display for Error {
4547
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> Result<(), ::std::fmt::Error> {
4648
let description = match *self {
@@ -93,6 +95,8 @@ pub mod audio_codec {
9395
}
9496
}
9597

98+
impl std::error::Error for Error {}
99+
96100
impl ::std::fmt::Display for Error {
97101
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> Result<(), ::std::fmt::Error> {
98102
let description = match *self {
@@ -139,6 +143,8 @@ pub mod audio_format {
139143
}
140144
}
141145

146+
impl std::error::Error for Error {}
147+
142148
impl ::std::fmt::Display for Error {
143149
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> Result<(), ::std::fmt::Error> {
144150
let description = match *self {
@@ -209,6 +215,8 @@ pub mod audio_unit {
209215
}
210216
}
211217

218+
impl std::error::Error for Error {}
219+
212220
impl ::std::fmt::Display for Error {
213221
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> Result<(), ::std::fmt::Error> {
214222
let description = match *self {
@@ -302,6 +310,8 @@ impl Error {
302310
}
303311
}
304312

313+
impl std::error::Error for Error {}
314+
305315
impl ::std::fmt::Display for Error {
306316
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> Result<(), ::std::fmt::Error> {
307317
match *self {

0 commit comments

Comments
 (0)