Skip to content

Commit

Permalink
Merge #339
Browse files Browse the repository at this point in the history
339: Fix syntax in two doctests and un-ignored one r=jeehoonkang a=rvolgers



Co-authored-by: Ronald Volgers <rvolgers@users.noreply.github.com>
  • Loading branch information
bors[bot] and rvolgers committed Mar 5, 2019
2 parents e9a9366 + 84877bf commit 1f8ccb1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crossbeam-utils/src/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,22 @@
//! // Not going to compile because we're trying to borrow `s`,
//! // which lives *inside* the scope! :(
//! s.spawn(|_| println!("nested thread"));
//! }});
//! });
//! });
//! ```
//!
//! Fortunately, there is a solution. Every scoped thread is passed a reference to its scope as an
//! argument, which can be used for spawning nested threads:
//!
//! ```ignore
//! ```
//! use crossbeam_utils::thread;
//!
//! thread::scope(|s| {
//! // Note the `|s|` here.
//! s.spawn(|s| {
//! // Yay, this works because we're using a fresh argument `s`! :)
//! s.spawn(|_| println!("nested thread"));
//! }});
//! });
//! });
//! ```
//!
Expand Down

0 comments on commit 1f8ccb1

Please sign in to comment.