-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Document try!'s error conversion behaviour #36099
Conversation
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
/// it provides. | ||
/// error if the value of the expression is `Err`. It additionally provides | ||
/// automatic conversions of errors into other errors using `From`. | ||
/// Can only be used in functions that return `Result` because of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Can/It can/
/// Can only be used in functions that return `Result` because of the | ||
/// early return of `Err` that it provides. | ||
/// | ||
/// `try!` unwraps the given `Result` and, in case of an `Ok` variant, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"unwrap" is an unfortunate choice of words here, since unwrap()
is a method, and it doesn't use it
ac71520
to
33ba3df
Compare
Fixed all comments. |
33ba3df
to
dea3179
Compare
dea3179
to
0f8eb81
Compare
@steveklabnik updated. Made it more concise (hopefully) and direct. |
I'm into it. Build failure looks spurious. Thanks! @bors: r+ rollup |
📌 Commit 0f8eb81 has been approved by |
…teveklabnik Document try!'s error conversion behaviour try!'s documentation currently doesn't document the error conversion behaviour of the macro. This patch extends the documentation. Open questions: * is it worthwhile to have seperate examples with and without wrapping behaviour? It's not immediately obvious that From<T> for T is always defined. Though this is necessary for the macro to work in any case, is this the place to expect that knowledge.
…teveklabnik Document try!'s error conversion behaviour try!'s documentation currently doesn't document the error conversion behaviour of the macro. This patch extends the documentation. Open questions: * is it worthwhile to have seperate examples with and without wrapping behaviour? It's not immediately obvious that From<T> for T is always defined. Though this is necessary for the macro to work in any case, is this the place to expect that knowledge.
…teveklabnik Document try!'s error conversion behaviour try!'s documentation currently doesn't document the error conversion behaviour of the macro. This patch extends the documentation. Open questions: * is it worthwhile to have seperate examples with and without wrapping behaviour? It's not immediately obvious that From<T> for T is always defined. Though this is necessary for the macro to work in any case, is this the place to expect that knowledge.
try!'s documentation currently doesn't document the error conversion behaviour of the macro. This patch extends the documentation.
Open questions: