diff options
| -rw-r--r-- | src/libstd/macros.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 362296cd133..6a5e46e9ed0 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -152,12 +152,14 @@ macro_rules! try { /// thread::spawn(move|| { long_running_task(); tx1.send(()).unwrap(); }); /// thread::spawn(move|| { tx2.send(calculate_the_answer()).unwrap(); }); /// -/// select! ( +/// select! { /// _ = rx1.recv() => println!("the long running task finished first"), /// answer = rx2.recv() => { /// println!("the answer was: {}", answer.unwrap()); /// } -/// ) +/// } +/// # drop(rx1.recv()); +/// # drop(rx2.recv()); /// ``` /// /// For more information about select, see the `std::sync::mpsc::Select` structure. |
