diff options
| author | bors <bors@rust-lang.org> | 2015-12-06 08:50:49 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-12-06 08:50:49 +0000 |
| commit | 078aff89285d4e032f2a7fcd71dd9c87fb9a1a6f (patch) | |
| tree | 33a3b44fc79a42b776cffc829f6c22031c79af7a /src | |
| parent | 3ffc6f0450ad2a462370235fb30cc23190f03cc7 (diff) | |
| parent | bfb73615406dbc8ad2c948c1312a32afa7fb1877 (diff) | |
| download | rust-078aff89285d4e032f2a7fcd71dd9c87fb9a1a6f.tar.gz rust-078aff89285d4e032f2a7fcd71dd9c87fb9a1a6f.zip | |
Auto merge of #30221 - thyrgle:concurrency_doc, r=alexcrichton
The example code in the Channels subsection of the rust book give warnings about
unused result which must be used, #[warn(unused_must_use)] on by default
Added a small pattern match to resolve those warnings.
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc/book/concurrency.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/doc/book/concurrency.md b/src/doc/book/concurrency.md index cc6cfc2f4a0..8ea6f4f6fcc 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(); }); } |
