Skip to content

Minor changes to Ipv4Addr - #75110

Merged
bors merged 1 commit into
rust-lang:masterfrom
tesuji:ip-endianness
Aug 24, 2020
Merged

Minor changes to Ipv4Addr#75110
bors merged 1 commit into
rust-lang:masterfrom
tesuji:ip-endianness

Conversation

@tesuji

@tesujitesuji commented Aug 3, 2020

Copy link
Copy Markdown
Contributor

Minor changes to Ipv4Addr

  • Impl IntoInner rather than AsInner for Ipv4Addr
  • Add some comments
  • Add test to show endiannes of Ipv4Addr display

Comment threadlibrary/std/src/net/addr.rs Outdated
@tesuji
tesujiforce-pushed the ip-endianness branch 3 times, most recently from 083b739 to 2c5e292CompareAugust 3, 2020 16:27
Comment threadlibrary/std/src/net/ip.rs Outdated
Comment threadlibrary/std/src/net/ip.rs Outdated
@tesuji
tesujiforce-pushed the ip-endianness branch 3 times, most recently from 13ada0d to 833dbb5CompareAugust 5, 2020 03:15
@tesuji
tesuji marked this pull request as ready for review August 5, 2020 03:17
Comment threadlibrary/std/src/net/ip.rs Outdated
Comment threadlibrary/std/src/net/addr.rs Outdated
@pickfire

Copy link
Copy Markdown
Contributor

Do we have like benchmark for this to see if it improves performance?

@tesuji

Copy link
Copy Markdown
ContributorAuthor

Do we have like benchmark for this to see if it improves performance?

Never claimed this PR will improve performance. Rather I try to enforce endianness of Ipv4Addr,
but I am not sure effectiveness of it in the future.

Comment threadlibrary/std/src/net/addr.rs Outdated
Comment threadlibrary/std/src/net/endian.rs Outdated
Comment threadlibrary/std/src/net/endian.rs Outdated
Comment threadlibrary/std/src/net/ip.rs Outdated
Comment threadlibrary/std/src/net/addr.rs Outdated

@RalfJungRalfJung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some more comments; with that, this is fine from a UCG perspective.

But I can't judge if this is actually a change that we want or if it improves the readability of the code here -- I find it about equally difficult to follow before and after. Somehow highfive did not assign a reviewer, so r? @Mark-Simulacrum

Comment threadlibrary/std/src/net/addr.rs Outdated
Comment threadlibrary/std/src/net/addr.rs Outdated
Comment threadlibrary/std/src/net/endian.rs Outdated
Comment threadlibrary/std/src/net/endian.rs Outdated
Comment threadlibrary/std/src/net/ip.rs Outdated
@RalfJung

Copy link
Copy Markdown
Member

And again for the bot to see: r? @Mark-Simulacrum

@RalfJung

Copy link
Copy Markdown
Member

(I have no idea who would be a good reviewer and thanks to the library/ rename I can't easily access the history of this file to find out. Feel free to reassign to someone more appropriate.)

@tesuji

Copy link
Copy Markdown
ContributorAuthor

(You could use git blame locally).

@tesuji

Copy link
Copy Markdown
ContributorAuthor

Thanks a lot about your help here, @RalfJung . I am really happy about that.

@Mark-Simulacrum

Copy link
Copy Markdown
Member

Please update the description in the top-level comment to match what this PR does after the latest changes, and squash the commits into one. With that done I think this will be good to go.

@tesuji

Copy link
Copy Markdown
ContributorAuthor

Done.

@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Aug 18, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 3b2c0a9 has been approved by Mark-Simulacrum

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 18, 2020
tmandry added a commit to tmandry/rust that referenced this pull request Aug 18, 2020
…crum
Minor changes to Ipv4Addr
Minor changes to Ipv4Addr
* Impl IntoInner rather than AsInner for Ipv4Addr
* Add some comments
* Add test to show endiannes of Ipv4Addr display
@tmandrytmandry mentioned this pull request Aug 18, 2020
@tmandry

tmandry commented Aug 18, 2020

Copy link
Copy Markdown
Member

Failed in #75683 (comment), @bors r-

@borsbors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 18, 2020
@tesuji

tesuji commented Aug 19, 2020

Copy link
Copy Markdown
ContributorAuthor

Thanks. The issue happened because in netbsd, in_addr is repr(packed).
I haven't found repr(packed)struct in_addr in other platforms in libc crate.

* Impl IntoInner rather than AsInner for Ipv4Addr
* Add some comments
* Add test to show endiannes of Ipv4Addr display
@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 20, 2020
@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Aug 24, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 768509f has been approved by Mark-Simulacrum

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 24, 2020
@bors

bors commented Aug 24, 2020

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 768509f with merge f44c6e4...

@bors

bors commented Aug 24, 2020

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions, checks-azure
Approved by: Mark-Simulacrum
Pushing f44c6e4 to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Aug 24, 2020
@bors
bors merged commit f44c6e4 into rust-lang:masterAug 24, 2020
@tesuji
tesuji deleted the ip-endianness branch August 24, 2020 23:45
@cuvipercuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@tesuji@pickfire@RalfJung@oli-obk@bors@Mark-Simulacrum@tmandry@cuviper@rustbot