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
Uint: Add support for bit and,or,xor assign traits #690
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Could you add some tests for the added methods, please?
Sure, are the ones I just added okay? |
x ^= b; | ||
assert_eq!(x, a ^ b); | ||
} | ||
// shr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like shr
and shl
were already implemented and you just added tests for them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is correct, I couldn't find the tests for them and figured it wouldn't hurt to add them.
Just FYI you broke semver and one of my crates with this (edit: not this PR in and of itself, the 0.9.5 update should have been 0.10) |
@AaronKutch could you share what broke in 0.9.5 compared to 0.9.4? This is the only change there. Or did you mean that some version in the 0.9.x series was semver breaking? In that case I would suspect 0.9.2 https://github.com/paritytech/parity-common/blob/master/uint/CHANGELOG.md#092---2022-01-28 breaking MSRV, which we I personally consider non-breaking, but some people disagree. |
I had implemented some traits for the struct from |
I see. Thanks for the clarification. If we follow that logic, then adding an inherent method would also be considered breaking, because a user could have added a method with the same name as well. The docs says adding adding an inherent item is considered a "possibly-breaking" change (not for the macro case though): https://doc.rust-lang.org/cargo/reference/semver.html#possibly-breaking-change-adding-any-inherent-items. I'll consider major release for such changes next time. Thanks for bringing this to my attention :) |
Add support uint support for traits
BitAndAssign
,BitXorAssign
andBitOrAssign
.Fixes #401