Skip to content
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

show mutex module doc, add method examples #2405

Merged
merged 12 commits into from
Apr 21, 2020
Merged

Conversation

jxs
Copy link
Member

@jxs jxs commented Apr 14, 2020

Motivation

Mutex module doc is not showing, doc is using inner doc comments, but the Mutex mod is private

Solution

this PR makes it visible again by switching the inner doc comments with outer doc comments.
This Pr also adds examples to Mutex's methods

tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

I have a few comments.

tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
tokio/src/sync/mutex.rs Show resolved Hide resolved
tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
jxs and others added 2 commits April 14, 2020 15:58
tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
@jxs
Copy link
Member Author

jxs commented Apr 15, 2020

updated

@Darksonn
Copy link
Contributor

It looks like you have some failing tests.

@jxs
Copy link
Member Author

jxs commented Apr 15, 2020

thanks, updated.
Apparently TryLockError was not public, made it so by exporting it in the sync mod

@jonhoo jonhoo added A-tokio Area: The main tokio crate C-maintenance Category: PRs that clean code up or issues documenting cleanup. M-sync Module: tokio/sync S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-docs Topic: documentation labels Apr 17, 2020
@jxs jxs requested a review from Darksonn April 20, 2020 19:24
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

I compiled it locally and had a read-through. I have commented anything I noticed grammar-wise below.

tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
@Darksonn Darksonn added S-waiting-on-author Status: awaiting some action (such as code changes) from the PR or issue author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 20, 2020
@jxs jxs requested a review from Darksonn April 20, 2020 21:42
tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
@jxs jxs requested a review from Darksonn April 21, 2020 13:01
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

I think this looks good now. 👍

@Darksonn
Copy link
Contributor

@taiki-e Do you want another chance at reviewing this before I merge it?

Copy link
Member

@taiki-e taiki-e left a comment

Choose a reason for hiding this comment

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

LGTM aside from a few small nits.

tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
jxs and others added 2 commits April 21, 2020 18:07
@jxs jxs requested a review from taiki-e April 21, 2020 17:29
@Darksonn Darksonn merged commit 6349efd into tokio-rs:master Apr 21, 2020
@Darksonn Darksonn removed the S-waiting-on-author Status: awaiting some action (such as code changes) from the PR or issue author. label Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-maintenance Category: PRs that clean code up or issues documenting cleanup. M-sync Module: tokio/sync T-docs Topic: documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants