-
Notifications
You must be signed in to change notification settings - Fork 45
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
Increment and decrement methods for Integer trait? #2
Comments
Sure, that could be useful. The trait will have to provide default implementations in order for this to not be a breaking change, which means it probably has to require |
this would be really handy |
I've just discovered the the as in- pub trait Integer: Step {
...
} or users can just use the |
It would be a breaking change for |
Closed by #53 |
From @L117 on June 22, 2017 9:55
When dealing with primitive integers it's fast and easy to increment/decrement with
x += 1;
/x -= 1;
, but withBigInt
/BigUint
it wastes an allocation and/or becomes tedious (Imagine callingOne::one
,From::from
and definingstatic ONE
). So such methods could come in handy.Copied from original issue: rust-num/num#307
The text was updated successfully, but these errors were encountered: