File tree Expand file tree Collapse file tree 5 files changed +15
-5
lines changed
Expand file tree Collapse file tree 5 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,9 @@ fn main() {
9191 io :: stdin (). read_line (& mut user_input ). ok ();
9292
9393 // 5. Not needed as the async client will cease processing on `drop`.
94- active_client . deactivate (). unwrap ();
94+ if let Err (err ) = active_client . deactivate () {
95+ eprintln! (" JACK exited with error: {err}" );
96+ }
9597}
9698```
9799
Original file line number Diff line number Diff line change @@ -41,7 +41,9 @@ fn main() {
4141 let mut user_input = String :: new ( ) ;
4242 io:: stdin ( ) . read_line ( & mut user_input) . ok ( ) ;
4343
44- active_client. deactivate ( ) . unwrap ( ) ;
44+ if let Err ( err) = active_client. deactivate ( ) {
45+ eprintln ! ( "JACK exited with error: {err}" ) ;
46+ } ;
4547}
4648
4749struct Notifications ;
Original file line number Diff line number Diff line change @@ -105,5 +105,7 @@ fn main() {
105105 io:: stdin ( ) . read_line ( & mut user_input) . ok ( ) ;
106106
107107 // Optional deactivation.
108- active_client. deactivate ( ) . unwrap ( ) ;
108+ if let Err ( err) = active_client. deactivate ( ) {
109+ eprintln ! ( "JACK exited with error: {err}" ) ;
110+ } ;
109111}
Original file line number Diff line number Diff line change @@ -66,7 +66,9 @@ fn main() {
6666 // 6. Optional deactivate. Not required since active_client will deactivate on
6767 // drop, though explicit deactivate may help you identify errors in
6868 // deactivate.
69- active_client. deactivate ( ) . unwrap ( ) ;
69+ if let Err ( err) = active_client. deactivate ( ) {
70+ eprintln ! ( "JACK exited with error: {err}" ) ;
71+ } ;
7072}
7173
7274/// Attempt to read a frequency from standard in. Will block until there is
Original file line number Diff line number Diff line change @@ -28,7 +28,9 @@ use crate::Error;
2828/// // An active async client is created, `client` is consumed.
2929/// let active_client = client.activate_async((), process_handler).unwrap();
3030/// // When done, deactivate the client.
31- /// active_client.deactivate().unwrap();
31+ /// if let Err(err) = active_client.deactivate() {
32+ /// eprintln!("Error deactivating client: {err}");
33+ /// };
3234/// ```
3335#[ must_use = "The jack client is shut down when the AsyncClient is dropped. You most likely want to keep this alive and manually tear down with `AsyncClient::deactivate`." ]
3436pub struct AsyncClient < N , P > {
You can’t perform that action at this time.
0 commit comments