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

Add portability note to tokio::main #3199

Merged
merged 2 commits into from
Nov 30, 2020
Merged

Conversation

pickfire
Copy link
Contributor

Mention that tokio::main could be use in any function.

Fix #3195

Motivation

It is not easy to discover that #[tokio::main] could be used for non-main functions.

Solution

Explain this in docs, maybe it would be better to show an example.

Mention that tokio::main could be use in any function.

Fix tokio-rs#3195
@Darksonn Darksonn added A-tokio Area: The main tokio crate C-maintenance Category: PRs that clean code up or issues documenting cleanup. M-macros Module: macros in the main Tokio crate T-docs Topic: documentation labels Nov 30, 2020
tokio-macros/src/lib.rs Outdated Show resolved Hide resolved
Co-authored-by: Alice Ryhl <alice@ryhl.io>
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!

@Darksonn Darksonn merged commit 72d6346 into tokio-rs:master Nov 30, 2020
@pickfire pickfire deleted the patch-1 branch December 1, 2020 17:06
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-macros Module: macros in the main Tokio crate T-docs Topic: documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-main async fn
2 participants