-
Notifications
You must be signed in to change notification settings - Fork 218
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
Remove From [u8; n] impl for uint types #859
Conversation
5024f87
to
6a65ee6
Compare
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. The From
implementation already bit me when converting from little endian.
I am not sure of we should also bump the version in this PR or if this is done at release time.
Co-authored-by: Alexander Theißen <[email protected]>
Looks like bumping is done in releases, I can update the changelogs once this is approved by owners |
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.
FWIW the alloy_primitives U256
doesn't support this conversion neither (although I don't know the exact reason).
Implementing |
Updating the changelogs should ideally happen in the PR itself. If you want to release a new version straight away, you can also bump the versions here. Note that this breaking change will propagate to other crates like Releasing a new version then should be easy: |
Agreed. This code in uint is very old and predates these guidelines probably. |
Changes:
Since uint types can be both encoded with little-endian or big-endian format, the From implementation can easily be misused.
to_big_endian
andto_little_endian
are renamedwrite_as_*
to_little_endian
andto_big_endian
are now functions that returns the bytes array