diff --git a/src/doc/book/concurrency.md b/src/doc/book/concurrency.md index cc6cfc2f4a09..8ea6f4f6fcc2 100644 --- a/src/doc/book/concurrency.md +++ b/src/doc/book/concurrency.md @@ -295,12 +295,12 @@ fn main() { let mut data = data.lock().unwrap(); *data += 1; - tx.send(()); + tx.send(()).unwrap(); }); } for _ in 0..10 { - rx.recv(); + rx.recv().unwrap(); } } ``` @@ -324,7 +324,7 @@ fn main() { thread::spawn(move || { let answer = i * i; - tx.send(answer); + tx.send(answer).unwrap(); }); }