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

Replace BoxedUint::new with ::zero_with_precision #327

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

tarcieri
Copy link
Member

The two APIs are nearly identical. The only difference is the latter is infallible and panics if an invalid precision is given.

This also changes BoxedUint::max to have the same behavior.

Whether they should panic is a debatable point. Indeed having both options would be good, but it should probably return CtOption where BoxedUint::max was returning Option.

Regardless, this removes duplication and makes the API at least more consistent with itself.

The two APIs are nearly identical. The only difference is the latter is
infallible and panics if an invalid precision is given.

This also changes `BoxedUint::max` to have the same behavior.

Whether they should panic is a debatable point. Indeed having both
options would be good, but it should probably return `CtOption` where
`BoxedUint::max` was returning `Option`.

Regardless, this removes duplication and makes the API at least more
consistent with itself.
@tarcieri tarcieri merged commit e334064 into master Nov 27, 2023
15 checks passed
@tarcieri tarcieri deleted the boxed-uint/replace-new-with-zero branch November 27, 2023 01:15
@tarcieri tarcieri mentioned this pull request Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant