Skip to content

Commit

Permalink
Rollup merge of rust-lang#115197 - tbu-:pr_simpler_ipv6_addr_display,…
Browse files Browse the repository at this point in the history
… r=joshtriplett

Remove special cases that are no longer needed due to rust-lang#112606

cc rust-lang#112606
  • Loading branch information
matthiaskrgr authored Aug 26, 2023
2 parents 42857db + 5e76e20 commit 8e35b20
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions library/core/src/net/ip_addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1856,13 +1856,7 @@ impl fmt::Display for Ipv6Addr {
if f.precision().is_none() && f.width().is_none() {
let segments = self.segments();

// Special case for :: and ::1; otherwise they get written with the
// IPv4 formatter
if self.is_unspecified() {
f.write_str("::")
} else if self.is_loopback() {
f.write_str("::1")
} else if let Some(ipv4) = self.to_ipv4_mapped() {
if let Some(ipv4) = self.to_ipv4_mapped() {
write!(f, "::ffff:{}", ipv4)
} else {
#[derive(Copy, Clone, Default)]
Expand Down

0 comments on commit 8e35b20

Please sign in to comment.