Remove From [u8; n] impl for uint types#859
Conversation
5024f87 to
6a65ee6
Compare
athei
left a comment
There was a problem hiding this comment.
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 |
xermicus
left a comment
There was a problem hiding this comment.
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_endianandto_little_endianare renamedwrite_as_*to_little_endianandto_big_endianare now functions that returns the bytes array