File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -485,15 +485,17 @@ impl Builder {
485
485
/// let (tx, rx) = channel();
486
486
///
487
487
/// let sender = thread::spawn(move || {
488
- /// let _ = tx.send("Hello, thread".to_owned());
488
+ /// tx.send("Hello, thread".to_owned())
489
+ /// .expect("Unable to send on channel");
489
490
/// });
490
491
///
491
492
/// let receiver = thread::spawn(move || {
492
- /// println!("{}", rx.recv().unwrap());
493
+ /// let value = rx.recv().expect("Unable to receive from channel");
494
+ /// println!("{}", value);
493
495
/// });
494
496
///
495
- /// let _ = sender.join();
496
- /// let _ = receiver.join();
497
+ /// sender.join().expect("The sender thread has panicked" );
498
+ /// receiver.join().expect("The receiver thread has panicked" );
497
499
/// ```
498
500
///
499
501
/// A thread can also return a value through its [`JoinHandle`], you can use
@@ -1192,7 +1194,7 @@ impl<T> JoinInner<T> {
1192
1194
/// });
1193
1195
/// });
1194
1196
///
1195
- /// let _ = original_thread.join();
1197
+ /// original_thread.join().expect("The thread being joined has panicked" );
1196
1198
/// println!("Original thread is joined.");
1197
1199
///
1198
1200
/// // We make sure that the new thread has time to run, before the main
You can’t perform that action at this time.
0 commit comments