Skip to content

Commit 8e35b20

Browse files
authored
Rollup merge of #115197 - tbu-:pr_simpler_ipv6_addr_display, r=joshtriplett
Remove special cases that are no longer needed due to #112606 cc #112606
2 parents 42857db + 5e76e20 commit 8e35b20

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

library/core/src/net/ip_addr.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1856,13 +1856,7 @@ impl fmt::Display for Ipv6Addr {
18561856
if f.precision().is_none() && f.width().is_none() {
18571857
let segments = self.segments();
18581858

1859-
// Special case for :: and ::1; otherwise they get written with the
1860-
// IPv4 formatter
1861-
if self.is_unspecified() {
1862-
f.write_str("::")
1863-
} else if self.is_loopback() {
1864-
f.write_str("::1")
1865-
} else if let Some(ipv4) = self.to_ipv4_mapped() {
1859+
if let Some(ipv4) = self.to_ipv4_mapped() {
18661860
write!(f, "::ffff:{}", ipv4)
18671861
} else {
18681862
#[derive(Copy, Clone, Default)]

0 commit comments

Comments
 (0)