-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding links and examples for various mspc pages #29377 #41438
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
Thanks for the pull request @projektir! We'll make sure that @brson or another reviewer take a look at this in a reasonable amount of time. |
@projektir looks like the travis tests may be failing? Other than that looks good to me! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small nits, but this looks good to me overall! Thanks @projektir 😁
Edit: oops, didn't add all the comments...
src/libstd/sync/mpsc/mod.rs
Outdated
/// let mut msg; | ||
/// | ||
/// msg = receiver.recv().unwrap(); | ||
/// assert_eq!(1, msg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is failing the test because there is a race condition.
src/libstd/sync/mpsc/mod.rs
Outdated
/// An iterator over messages on a receiver, this iterator will block whenever | ||
/// [`next`] is called, waiting for a new message, and [`None`] will be returned | ||
/// An iterator over messages on a [`Receiver`], created by [`iter`]. | ||
/// This iterator will block whenever [`next`] is called, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you put a newline after the first sentence? The summary is quite long otherwise.
src/libstd/sync/mpsc/mod.rs
Outdated
/// [`None`] will be returned when there are no pending values remaining or if | ||
/// the corresponding channel has hung up. | ||
/// An iterator that attempts to yield all pending values for a [`Receiver`], | ||
/// created by [`try_iter`]. [`None`] will be returned when there |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
src/libstd/sync/mpsc/mod.rs
Outdated
/// whenever [`next`] is called, waiting for a new message, and [`None`] will be | ||
/// returned when the corresponding channel has hung up. | ||
/// An owning iterator over messages on a [`Receiver`], | ||
/// created by **Receiver::into_iter**. This iterator will block whenever [`next`] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above. Can you also make into_iter
into a link and format it the same way as you did for the summaries for Iter
and TryIter
?
@lukaramu this should be good for another review now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now! 👌
@bors: r+ |
📌 Commit d7efbec has been approved by |
Adding links and examples for various mspc pages rust-lang#29377 Adding links and copying examples for the various Iterators; adding some extra stuff to `Sender`/`SyncSender`/`Receiver`.
Adding links and examples for various mspc pages rust-lang#29377 Adding links and copying examples for the various Iterators; adding some extra stuff to `Sender`/`SyncSender`/`Receiver`.
src/libstd/sync/mpsc/mod.rs
Outdated
@@ -949,16 +1145,17 @@ impl<T> Receiver<T> { | |||
/// | |||
/// This function will always block the current thread if there is no data | |||
/// available and it's possible for more data to be sent. Once a message is | |||
/// sent to the corresponding [`Sender`], then this receiver will wake up and | |||
/// return that message. | |||
/// sent to the corresponding [`Sender`] (or [`SyncSender`]), then this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://travis-ci.org/rust-lang/rust/jobs/225404572
this line causes a failure on travis.
this is considered a markdown link:
[foo] (bar.html)
for the same reason this is:
[`Sender`] (or [`SyncSender`])
to get around this, do something like this:
[`Sender`][`Sender`] (or [`SyncSender`])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, how did Travis not pick it up last time. 😕 Or the tests I ran, for that matter.
@bors r- |
...I want to say it should be good to merge now? |
Lookin' good! @bors: r+ rollup |
📌 Commit c59b188 has been approved by |
Adding links and examples for various mspc pages rust-lang#29377 Adding links and copying examples for the various Iterators; adding some extra stuff to `Sender`/`SyncSender`/`Receiver`.
Adding links and examples for various mspc pages rust-lang#29377 Adding links and copying examples for the various Iterators; adding some extra stuff to `Sender`/`SyncSender`/`Receiver`.
Adding links and examples for various mspc pages rust-lang#29377 Adding links and copying examples for the various Iterators; adding some extra stuff to `Sender`/`SyncSender`/`Receiver`.
Adding links and copying examples for the various Iterators; adding some extra stuff to
Sender
/SyncSender
/Receiver
.