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

feat: add wait alias to sleep #3897

Merged
merged 2 commits into from Jun 28, 2021
Merged

feat: add wait alias to sleep #3897

merged 2 commits into from Jun 28, 2021

Conversation

Milo123459
Copy link
Contributor

Motivation

I was searching for how to wait, and I couldn't find anything so I then looked for sleep after 5 minutes. Now, on the docs, if you search for wait the sleep method will come up.

Solution

I added a #[doc(alias = "wait")] to make it so when you search on the docs for wait, you will get shown the sleep method.

@Milo123459 Milo123459 changed the title Add sleep alias wait feat: add wait alias to sleep Jun 28, 2021
@Darksonn Darksonn added A-tokio Area: The main tokio crate M-time Module: tokio/time T-docs Topic: documentation labels Jun 28, 2021
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.

Thanks!

tokio/src/time/driver/sleep.rs Outdated Show resolved Hide resolved
@Milo123459
Copy link
Contributor Author

Ah, thank you very much! Are there any plans to make the minimum rust version supporting the docs attribute?

@Darksonn
Copy link
Contributor

Well, we don't need to as we are able to use doc aliases via cfg_attr.

@Darksonn Darksonn merged commit ab0791b into tokio-rs:master Jun 28, 2021
@Milo123459
Copy link
Contributor Author

Cool, thank you!

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 M-time Module: tokio/time T-docs Topic: documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants