Skip to content
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

T should implement From<NonZeroT> #54171

Closed
orlp opened this issue Sep 13, 2018 · 0 comments · Fixed by #54240
Closed

T should implement From<NonZeroT> #54171

orlp opened this issue Sep 13, 2018 · 0 comments · Fixed by #54240
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@orlp
Copy link
Contributor

orlp commented Sep 13, 2018

I'd really expect this to just work:

let nz = NonZeroU32::new(5).unwrap();
let k: u32 = nz.into();

All NonZeroT types should implement From<NonZeroT> for T, as this conversion is always possible and free.

@orlp orlp changed the title NonZeroU32 and co do not implement From NonZeroU32 and co do not implement From Sep 13, 2018
@shepmaster shepmaster changed the title NonZeroU32 and co do not implement From T should implement From<NonZeroT> Sep 13, 2018
@shepmaster shepmaster added the C-feature-request Category: A feature request, i.e: not implemented / a PR. label Sep 13, 2018
@Havvy Havvy added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Sep 13, 2018
bors added a commit that referenced this issue Sep 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants