impl TryFrom from native to NonZero#72846
impl TryFrom from native to NonZero#72846heca-project wants to merge 3 commits intorust-lang:masterfrom
Conversation
You can now do the following:
```
let p: u8 = 5;
let q: NonZeroU8 = p.try_into()?;
```
Which improves API design a bit nicer.
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @kennytm (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Remove not needed unsafe Co-authored-by: kennytm <[email protected]>
|
still a r? @SimonSapin |
|
In #72717 I had tests written for this if you want them. Writing a |
You can now do the following: