Skip to content

Commit

Permalink
Remove special cases that are no longer needed due to rust-lang#112606
Browse files Browse the repository at this point in the history
  • Loading branch information
tbu- committed Aug 25, 2023
1 parent 4354192 commit 5e76e20
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 5e76e20

Please sign in to comment.