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
This commit is contained in:
Matthias Krüger 2023-08-26 13:08:33 +02:00 committed by GitHub
commit 8e35b2082c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1856,13 +1856,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
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)]