Skip to content

Adding links and examples for various mspc pages #29377 #41438

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Apr 28, 2017
Merged

Adding links and examples for various mspc pages #29377 #41438

merged 1 commit into from
Apr 28, 2017

Conversation

projektir
Copy link
Contributor

Adding links and copying examples for the various Iterators; adding some extra stuff to Sender/SyncSender/Receiver.

@rust-highfive
Copy link
Contributor

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@shepmaster
Copy link
Member

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.

@alexcrichton
Copy link
Member

@projektir looks like the travis tests may be failing? Other than that looks good to me!

@shepmaster shepmaster added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 21, 2017
Copy link
Contributor

@chordowl chordowl left a 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...

/// let mut msg;
///
/// msg = receiver.recv().unwrap();
/// assert_eq!(1, msg);
Copy link
Contributor

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.

/// 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,
Copy link
Contributor

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.

/// [`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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

/// 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`]
Copy link
Contributor

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?

@projektir
Copy link
Contributor Author

@lukaramu this should be good for another review now.

Copy link
Contributor

@chordowl chordowl left a 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! 👌

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Collaborator

bors commented Apr 24, 2017

📌 Commit d7efbec has been approved by alexcrichton

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Apr 24, 2017
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`.
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Apr 24, 2017
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`.
@@ -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
Copy link
Member

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`])

Copy link
Contributor Author

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.

@frewsxcv
Copy link
Member

@bors r-

@arielb1 arielb1 added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 25, 2017
@projektir
Copy link
Contributor Author

...I want to say it should be good to merge now?

@steveklabnik
Copy link
Member

Lookin' good!

@bors: r+ rollup

@bors
Copy link
Collaborator

bors commented Apr 27, 2017

📌 Commit c59b188 has been approved by steveklabnik

arielb1 pushed a commit to arielb1/rust that referenced this pull request Apr 27, 2017
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`.
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Apr 27, 2017
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`.
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Apr 27, 2017
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`.
bors added a commit that referenced this pull request Apr 28, 2017
Rollup of 7 pull requests

- Successful merges: #41438, #41523, #41526, #41546, #41556, #41572, #41578
- Failed merges:
@bors bors merged commit c59b188 into rust-lang:master Apr 28, 2017
@projektir projektir deleted the mpsc_docs branch April 28, 2017 21:53
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants