-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Examples and doctests should handle errors properly (no panics) #657
Milestone
Comments
carllerche
added
the
E-help-wanted
Call for participation: Help is requested to fix this issue.
label
Sep 22, 2018
I would like to contribute to this. To clarify, would use of "?" be recommended or match arms are more preferable or it is better to select depending on the particular context? @carllerche @liranringel |
@SanchayanMaity |
@liranringel Ok. |
I'm 👍 with this. |
This issue has been resolved :) |
Darksonn
removed
the
E-help-wanted
Call for participation: Help is requested to fix this issue.
label
Sep 25, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looking in the examples and even the doctests, errors are not handled properly (a lot of uses of
unwrap
andpanic
).Tokio should follow the best practices because it's a core component of the Rust ecosystem. It may mislead newbies that copy-paste those examples.
Today we have the
?
operator and can return errors from main, so it's not harder to do so. It is also recommended by the api-guidelines: https://rust-lang-nursery.github.io/api-guidelines/documentation.html#examples-use--not-try-not-unwrap-c-question-markThe text was updated successfully, but these errors were encountered: