diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2015-02-13 09:11:41 -0500 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2015-02-13 09:11:41 -0500 |
| commit | 805a31fb760873d3b973699403866ca08e8999ca (patch) | |
| tree | 3643c5e538cc0c0c239624987829fba4f2273493 /src/libstd/sync/mpsc | |
| parent | cf636c233dfeef5abf0de8fb35e23c0a161810d2 (diff) | |
| download | rust-805a31fb760873d3b973699403866ca08e8999ca.tar.gz rust-805a31fb760873d3b973699403866ca08e8999ca.zip | |
Improve documentation for `Select::new()`.
Remove incorrect claim, add example, reformat and re-word. Fixes #22266
Diffstat (limited to 'src/libstd/sync/mpsc')
| -rw-r--r-- | src/libstd/sync/mpsc/select.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/libstd/sync/mpsc/select.rs b/src/libstd/sync/mpsc/select.rs index babae93b2d4..87b2fe8f100 100644 --- a/src/libstd/sync/mpsc/select.rs +++ b/src/libstd/sync/mpsc/select.rs @@ -111,11 +111,18 @@ pub trait Packet { } impl Select { - /// Creates a new selection structure. This set is initially empty and - /// `wait` will panic!() if called. + /// Creates a new selection structure. This set is initially empty. /// - /// Usage of this struct directly can sometimes be burdensome, and usage is - /// rather much easier through the `select!` macro. + /// Usage of this struct directly can sometimes be burdensome, and usage is much easier through + /// the `select!` macro. + /// + /// # Examples + /// + /// ``` + /// use std::sync::mpsc::Select; + /// + /// let select = Select::new(); + /// ``` pub fn new() -> Select { Select { head: ptr::null_mut(), |
