diff --git a/examples/beep.rs b/examples/beep.rs index dc0edd2..96b9eaf 100644 --- a/examples/beep.rs +++ b/examples/beep.rs @@ -21,7 +21,7 @@ fn main() -> Result<(), failure::Error> { let data = match result { Ok(data) => data, Err(err) => { - eprintln!("stream {:?} closed due to an error: {}", id, err); + eprintln!("an error occurred on stream {:?}: {}", id, err); return; } }; diff --git a/examples/feedback.rs b/examples/feedback.rs index 29aec5e..95d634f 100644 --- a/examples/feedback.rs +++ b/examples/feedback.rs @@ -53,7 +53,7 @@ fn main() -> Result<(), failure::Error> { let data = match result { Ok(data) => data, Err(err) => { - eprintln!("stream {:?} closed due to an error: {}", id, err); + eprintln!("an error occurred on stream {:?}: {}", id, err); return; } }; diff --git a/examples/record_wav.rs b/examples/record_wav.rs index 0b58e01..66002df 100644 --- a/examples/record_wav.rs +++ b/examples/record_wav.rs @@ -34,7 +34,7 @@ fn main() -> Result<(), failure::Error> { let data = match event { Ok(data) => data, Err(err) => { - eprintln!("stream {:?} closed due to an error: {}", id, err); + eprintln!("an error occurred on stream {:?}: {}", id, err); return; } }; diff --git a/src/emscripten/mod.rs b/src/emscripten/mod.rs index 2ca7a93..78ffa96 100644 --- a/src/emscripten/mod.rs +++ b/src/emscripten/mod.rs @@ -45,7 +45,7 @@ impl EventLoop { #[inline] pub fn run(&self, callback: F) -> ! - where F: FnMut(StreamId, StreamDataResult) + Send, + where F: FnMut(StreamId, StreamDataResult), { // The `run` function uses `set_timeout` to invoke a Rust callback repeatidely. The job // of this callback is to fill the content of the audio buffers. diff --git a/src/lib.rs b/src/lib.rs index d496b32..0c04b11 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -70,7 +70,7 @@ //! //! ```no_run //! # let event_loop = cpal::EventLoop::new(); -//! event_loop.run(move |_stream_id, _stream_event| { +//! event_loop.run(move |_stream_id, _stream_result| { //! // react to stream events and read or write stream data here //! }); //! ``` @@ -90,8 +90,8 @@ //! use cpal::{StreamData, UnknownTypeOutputBuffer}; //! //! # let event_loop = cpal::EventLoop::new(); -//! event_loop.run(move |stream_id, stream_event| { -//! let stream_data = match stream_event { +//! event_loop.run(move |stream_id, stream_result| { +//! let stream_data = match stream_result { //! Ok(data) => data, //! Err(err) => { //! eprintln!("an error occurred on stream {:?}: {}", stream_id, err);