File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -485,15 +485,17 @@ impl Builder {
485485/// let (tx, rx) = channel();
486486///
487487/// 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");
489490/// });
490491///
491492/// let receiver = thread::spawn(move || {
492- /// println!("{}", rx.recv().unwrap());
493+ /// let value = rx.recv().expect("Unable to receive from channel");
494+ /// println!("{}", value);
493495/// });
494496///
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" );
497499/// ```
498500///
499501/// A thread can also return a value through its [`JoinHandle`], you can use
@@ -1192,7 +1194,7 @@ impl<T> JoinInner<T> {
11921194/// });
11931195/// });
11941196///
1195- /// let _ = original_thread.join();
1197+ /// original_thread.join().expect("The thread being joined has panicked" );
11961198/// println!("Original thread is joined.");
11971199///
11981200/// // 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