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

Deps: minimize Tokio features #25

Merged
merged 5 commits into from
Apr 14, 2022
Merged

Deps: minimize Tokio features #25

merged 5 commits into from
Apr 14, 2022

Conversation

BastiDood
Copy link
Contributor

Hello there! I noticed that the dependency on Tokio uses the full feature. This PR aims to resolve this by minimizing the enabled features.

While I was in main.rs, I also removed the use of the tokio::main macro. Now, CLI parsing occurs earlier than starting up the Tokio runtime. If parsing fails, then the program terminates early (i.e. no runtime initialization required). The observable behavior should still be the same.

If there are any issues, feel free to point them out. I'd gladly resolve them. Thanks! 🎉

Copy link
Owner

@ekzhang ekzhang left a comment

Choose a reason for hiding this comment

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

Thanks for limiting the features. It doesn't seem like there were many packages that were pruned as a result, but it's always good to have.

Clap does special things behind the scenes before it exits.
@ekzhang
Copy link
Owner

ekzhang commented Apr 14, 2022

Looks great, thank you!

@BastiDood
Copy link
Contributor Author

Looks great, thank you!

Thank you so much for the feedback. I definitely learned something new today about the tokio::main macro. 🥳

@ekzhang ekzhang merged commit b045d80 into ekzhang:main Apr 14, 2022
@BastiDood BastiDood deleted the deps/minimize-tokio-features branch April 15, 2022 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants