Use u16::to_be_bytes#1120
Merged
apoelstra merged 1 commit intorust-bitcoin:masterfrom Jul 25, 2022
Merged
Conversation
Kixunil
requested changes
Jul 22, 2022
Collaborator
There was a problem hiding this comment.
No worries, maybe it'll become non-issue. See #1123 (comment)
Collaborator
|
I suspect we have |
Collaborator
|
Oh, it's actually a clippy bug. Please use method call instead. It'll be clearer anyway. |
Member
|
I think the lint actually wouldn't fire regardless, because we do "use" the result by adding it to |
Collaborator
|
@apoelstra oh, yes, damn! Funny it still reproduces. |
7b2a277 to
ff75807
Compare
Kixunil
previously approved these changes
Jul 24, 2022
Collaborator
Kixunil
left a comment
There was a problem hiding this comment.
ACK ff7580708fa08de4cb46e48558354d3214294aba
But if it can be changed to method before anyone else reviews, it'd be nice.
Collaborator
There was a problem hiding this comment.
Any reason to not use the method?
Now that MSRV is > 1.32 we can use `u16::to_be_bytes` to ensure network byte order when encoding the port number of a `AddrV2Message`. Remove the TODO and use `to_be_bytes` as suggested.
ff75807 to
3c28694
Compare
Member
Author
|
Changes in force push
|
Kixunil
approved these changes
Jul 25, 2022
apoelstra
approved these changes
Jul 25, 2022
ChallengeDev210
pushed a commit
to ChallengeDev210/rust-bitcoin
that referenced
this pull request
Aug 1, 2022
3c28694 Use to_be_bytes (Tobin C. Harding) Pull request description: Now that MSRV is > 1.32 we can use `u16::to_be_bytes` to ensure network byte order when encoding the port number of a `AddrV2Message`. Remove the TODO and use `to_be_bytes` as suggested. ACKs for top commit: Kixunil: ACK 3c28694 apoelstra: ACK 3c28694 Tree-SHA512: b5dd9b0f43257f84defb9e9ecf9d02469f1959669367c5ad02cfb43003b780cf07ea344579b52a75c424fd85f8fa02dee3713b967c9b3a33eec6b7aa914763cd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Now that MSRV is > 1.32 we can use
u16::to_be_bytesto ensure network byte order when encoding the port number of aAddrV2Message.Remove the TODO and use
to_be_bytesas suggested.