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

Don't prefix 0x for each segments in dbg!(Ipv6) #81202

Merged
merged 2 commits into from
Jan 22, 2021
Merged

Conversation

tesuji
Copy link
Contributor

@tesuji tesuji commented Jan 20, 2021

Fixes #81182

@rust-highfive
Copy link
Collaborator

r? @shepmaster

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 20, 2021
@tesuji
Copy link
Contributor Author

tesuji commented Jan 20, 2021

Somehow all my PRs have been assigned to Jake recently.
r? @Amanieu

@rust-highfive rust-highfive assigned Amanieu and unassigned shepmaster Jan 20, 2021
Comment on lines 1616 to +1617
f.write_char(':')?;
fmt::LowerHex::fmt(segment, f)?;
write!(f, "{:x}", segment)?;
Copy link
Contributor

@pickfire pickfire Jan 20, 2021

Choose a reason for hiding this comment

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

                             write!(f, ":{:x}", segment)?;

Should we perhaps do this instead? I wonder if this will be optimized with reduced write calls.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think it makes much difference since the formatting code will call write_str on the ":" separately anyways.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am more concern about the style. However, I don't have a strong opinion on this.

Copy link
Contributor

Choose a reason for hiding this comment

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

I just wonder if there is a performance impact. Both works for me.

@Amanieu
Copy link
Member

Amanieu commented Jan 21, 2021

@bors r+

@bors
Copy link
Contributor

bors commented Jan 21, 2021

📌 Commit 116b66a has been approved by Amanieu

@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 Jan 21, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 22, 2021
Rollup of 10 pull requests

Successful merges:

 - rust-lang#80573 (Deny rustc::internal lints for rustdoc and clippy)
 - rust-lang#81173 (Expand docs on Iterator::intersperse)
 - rust-lang#81194 (Stabilize std::panic::panic_any.)
 - rust-lang#81202 (Don't prefix 0x for each segments in `dbg!(Ipv6)`)
 - rust-lang#81225 (Make 'docs' nullable in rustdoc-json output)
 - rust-lang#81227 (Remove doctree::StructType)
 - rust-lang#81233 (Document why not use concat! in dbg! macro)
 - rust-lang#81236 (Gracefully handle loop labels missing leading `'` in different positions)
 - rust-lang#81241 (Turn alloc's force_expr macro into a regular macro_rules.)
 - rust-lang#81242 (Enforce statically that `MIN_NON_ZERO_CAP` is calculated at compile time)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 950ed27 into rust-lang:master Jan 22, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 22, 2021
@tesuji tesuji deleted the dbg_ipv6 branch January 23, 2021 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: 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.

dbg! on Ipv6Addr should not show leading '0x'
7 participants