Skip to content

Conversation

@sorairolake
Copy link
Contributor

This pull request adds a method to NonZero<T> that parses a non-zero integer from a string slice with digits in a given base.

When using the combination of int::from_str_radix and NonZero::<T>::new, IntErrorKind::Zero cannot be returned as an error. When using NonZero::<T>::from_str, IntErrorKind::Zero can be returned as an error, but this method cannot parse non-decimal integers.

NonZero::<T>::from_str_radix can return IntErrorKind::Zero as an error, and can parse both decimal integers and non-decimal integers.

Important

ACP has not yet been approved, and this must be approved before this pull request is ready for review.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 1, 2026
@sorairolake
Copy link
Contributor Author

@rustbot label +T-libs-api -T-libs
r? libs-api

@rustbot rustbot added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants