Skip to content
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

Use DisplayBuffer for socket addresses. #100640

Merged
merged 7 commits into from
Sep 13, 2022

Conversation

reitermarkus
Copy link
Contributor

Continuation of #100625 for socket addresses.

Renames net::addr to net::addr::socket, net::ip to net::addr::ip and net::ip::display_buffer::IpDisplayBuffer to net::addr::display_buffer::DisplayBuffer.

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Aug 16, 2022
@rust-highfive
Copy link
Collaborator

r? @joshtriplett

(rust-highfive has picked a reviewer for you, use r? to override)

@rustbot
Copy link
Collaborator

rustbot commented Aug 16, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 16, 2022
@reitermarkus
Copy link
Contributor Author

r? @thomcc

@rust-highfive rust-highfive assigned thomcc and unassigned joshtriplett Aug 17, 2022
@thomcc
Copy link
Member

thomcc commented Aug 18, 2022

Can you add tests covering long addresses? E.g. ones that would catch an issue if the length used by the DisplayBuffers were wrong? It doesn't seem like we have these.


Also, to be clear (since it's not clear from the PR description), none of the renamed things are public API, this modifies internal stuff only.

That said, the renames are probably not that well motivated (since DisplayBuffer is plausibly more broadly useful than just here, and if we moved it elsewhere the module structure here would be slightly goofy), but I don't think it matters that much.

@reitermarkus
Copy link
Contributor Author

I added some tests for short and long addresses.

the renames are probably not that well motivated

the module structure here would be slightly goofy

I think addr::socket::SocketAddr and addr::ip::IpAddr makes more sense than addr::SocketAddr and ip::IpAddr.

I guess it would also make sense for parser to be in addr::parser instead.

@thomcc
Copy link
Member

thomcc commented Aug 19, 2022

I'm not sure this level of nesting helps?

@reitermarkus
Copy link
Contributor Author

I'm not sure this level of nesting helps?

How do you suggest to structure this?

@thomcc
Copy link
Member

thomcc commented Aug 22, 2022

How do you suggest to structure this?

I think what you had initially was probably better, but honestly I think just the changes so that DisplayBuffer is used for the parsing would be fine.

@bors
Copy link
Contributor

bors commented Aug 22, 2022

☔ The latest upstream changes (presumably #100881) made this pull request unmergeable. Please resolve the merge conflicts.

@thomcc thomcc 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-review Status: Awaiting review from the assignee but also interested parties. labels Aug 24, 2022
@rust-log-analyzer

This comment has been minimized.

@reitermarkus
Copy link
Contributor Author

I flattened the module structure again, but did rename addr to socket_addr and ip to ip_addr so the names are more symmetric.

@thomcc
Copy link
Member

thomcc commented Aug 24, 2022

Thank you. This looks great. Will approve after CI goes green.

@thomcc thomcc 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 24, 2022
@thomcc
Copy link
Member

thomcc commented Aug 25, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Aug 25, 2022

📌 Commit d61ecec has been approved by thomcc

It is now in the queue for this repository.

@bors bors 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 25, 2022
@reitermarkus reitermarkus force-pushed the socket-display-buffer branch 2 times, most recently from 3253d26 to 24e59f6 Compare September 12, 2022 17:27
@reitermarkus
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot 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 Sep 12, 2022
@thomcc
Copy link
Member

thomcc commented Sep 12, 2022

@Jarcho is this what you were looking for?

@thomcc
Copy link
Member

thomcc commented Sep 13, 2022

I'm fine with the library portion, so I'm going to reassign to @Jarcho for the review of the clippy changes, since I have no idea what I'm looking at there.

r? @Jarcho

@rust-highfive rust-highfive assigned Jarcho and unassigned thomcc Sep 13, 2022
@Jarcho
Copy link
Contributor

Jarcho commented Sep 13, 2022

Clippy changes look good.

@thomcc
Copy link
Member

thomcc commented Sep 13, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Sep 13, 2022

📌 Commit 14230a7 has been approved by thomcc

It is now in the queue for this repository.

@bors bors 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 Sep 13, 2022
@bors
Copy link
Contributor

bors commented Sep 13, 2022

⌛ Testing commit 14230a7 with merge c815756...

@bors
Copy link
Contributor

bors commented Sep 13, 2022

☀️ Test successful - checks-actions
Approved by: thomcc
Pushing c815756 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 13, 2022
@bors bors merged commit c815756 into rust-lang:master Sep 13, 2022
@rustbot rustbot added this to the 1.65.0 milestone Sep 13, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c815756): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
2.5% [2.5%, 2.5%] 1
Regressions ❌
(secondary)
1.6% [0.5%, 2.5%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.6% [-2.6%, -2.6%] 1
All ❌✅ (primary) 2.5% [2.5%, 2.5%] 1

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
2.8% [2.8%, 2.8%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.7% [-3.7%, -3.7%] 1
All ❌✅ (primary) 2.8% [2.8%, 2.8%] 1

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

@reitermarkus reitermarkus deleted the socket-display-buffer branch September 13, 2022 23:30
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 6, 2022
…r=thomcc

Use `DisplayBuffer` for socket addresses.

Continuation of rust-lang#100625 for socket addresses.

Renames `net::addr` to `net::addr::socket`, `net::ip` to `net::addr::ip` and `net::ip::display_buffer::IpDisplayBuffer` to `net::addr::display_buffer::DisplayBuffer`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants