-
Notifications
You must be signed in to change notification settings - Fork 19
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
ACP: add bitwise/bytewise methods to NonZero #413
Comments
We discussed this in the libs-api meeting today and these seem fine to add. |
imo you should add the |
@programmerjake those would be equivalent to NonZeroU32::new(u32::from_be(x)) Adding them wouldn't avoid any |
no, |
Oh never mind I was thinking of something else. Good point 👍 |
…bilee bitwise and bytewise methods on `NonZero` Implementation for `nonzero_bitwise` Tracking issue rust-lang#128281 ACP rust-lang/libs-team#413
…bilee bitwise and bytewise methods on `NonZero` Implementation for `nonzero_bitwise` Tracking issue rust-lang#128281 ACP rust-lang/libs-team#413
Rollup merge of rust-lang#128282 - pitaj:nonzero_bitwise, r=workingjubilee bitwise and bytewise methods on `NonZero` Implementation for `nonzero_bitwise` Tracking issue rust-lang#128281 ACP rust-lang/libs-team#413
Proposal
Problem statement
There are several integer methods which, when applied to a
NonZero
, could output aNonZero
. If added to theNonZero
type, these can make applying those operations toNonZero
types much easier and remove the need forunwrap
s.Motivating examples or use cases
Solution sketch
Alternatives
Do nothing, people continue needing to use
new_unchecked
orunwrap
.Links and related work
isqrt
forNonZero<uN>
#391NonZero::count_ones
What happens now?
This issue contains an API change proposal (or ACP) and is part of the libs-api team feature lifecycle. Once this issue is filed, the libs-api team will review open proposals as capability becomes available. Current response times do not have a clear estimate, but may be up to several months.
Possible responses
The libs team may respond in various different ways. First, the team will consider the problem (this doesn't require any concrete solution or alternatives to have been proposed):
Second, if there's a concrete solution:
The text was updated successfully, but these errors were encountered: