Skip to content

Add From<NonZero*> impls for wider NonZero types #66196

Closed
@newpavlov

Description

@newpavlov

For example in getrandom to convert NonZeroU16 to NonZeroU32 we have to write code like this:

num::NonZeroU32::new(e.get() as u32).unwrap().into()

Instead of using a simple e.into().

This issue has been assigned to @peter-wilkins via this comment.

Metadata

Metadata

Assignees

Labels

C-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions