docs(num): clarify conditions under which error occurs in impl TryFrom<int> for int - #162076
Open
sorairolake wants to merge 1 commit into
Open
docs(num): clarify conditions under which error occurs in impl TryFrom<int> for int#162076sorairolake wants to merge 1 commit into
impl TryFrom<int> for int#162076sorairolake wants to merge 1 commit into
Conversation
Collaborator
|
r? @JohnTitor rustbot has assigned @JohnTitor. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Contributor
Author
|
@rustbot label +A-docs |
impl TryFrom<int> for int
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
impl_try_from_unboundedalways returnsOk(T), but the documentation is written as if it may return an error, so I fixed this.I also clarified that
impl_try_from_lower_boundedreturns an error only when the source value is less thanT::MIN, andimpl_try_from_upper_boundedreturns an error only when the source value is greater thanT::MAX.While the original text
is fine for both cases, but I think the revised text makes it clearer that the error occurs at either the lower bound or the upper bound.
As for
impl_try_from_both_bounded, I think the current text is fine, so I have not made any changes to it.