Skip to content

Commit 805a31f

Browse files
committed
Improve documentation for Select::new().
Remove incorrect claim, add example, reformat and re-word. Fixes #22266
1 parent cf636c2 commit 805a31f

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/libstd/sync/mpsc/select.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,18 @@ pub trait Packet {
111111
}
112112

113113
impl Select {
114-
/// Creates a new selection structure. This set is initially empty and
115-
/// `wait` will panic!() if called.
114+
/// Creates a new selection structure. This set is initially empty.
116115
///
117-
/// Usage of this struct directly can sometimes be burdensome, and usage is
118-
/// rather much easier through the `select!` macro.
116+
/// Usage of this struct directly can sometimes be burdensome, and usage is much easier through
117+
/// the `select!` macro.
118+
///
119+
/// # Examples
120+
///
121+
/// ```
122+
/// use std::sync::mpsc::Select;
123+
///
124+
/// let select = Select::new();
125+
/// ```
119126
pub fn new() -> Select {
120127
Select {
121128
head: ptr::null_mut(),

0 commit comments

Comments
 (0)