From 2667547a9c5da85afcee570822b69a68b5412d8f Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Fri, 21 Jun 2019 15:57:15 +0200 Subject: [PATCH] Update lib docs to allow for testing on devices with no audio --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 2a273bb..3b6c5c8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,7 +23,7 @@ //! `default_*_device()` functions return an `Option` in case no device is available for that //! stream type on the system. //! -//! ``` +//! ```no_run //! let device = cpal::default_output_device().expect("no output device available"); //! ``` //! @@ -60,10 +60,10 @@ //! //! Now we must start the stream. This is done with the `play_stream()` method on the event loop. //! -//! ``` +//! ```no_run //! # let event_loop: cpal::EventLoop = return; //! # let stream_id: cpal::StreamId = return; -//! event_loop.play_stream(stream_id); +//! event_loop.play_stream(stream_id).expect("failed to play_stream"); //! ``` //! //! Now everything is ready! We call `run()` on the `event_loop` to begin processing.