diff options
Diffstat (limited to 'library/std')
| -rw-r--r-- | library/std/src/net/ip.rs | 7 | ||||
| -rw-r--r-- | library/std/src/os/unix/net/addr.rs | 2 |
2 files changed, 2 insertions, 7 deletions
diff --git a/library/std/src/net/ip.rs b/library/std/src/net/ip.rs index 140647128a9..da95fe21ac9 100644 --- a/library/std/src/net/ip.rs +++ b/library/std/src/net/ip.rs @@ -878,12 +878,7 @@ impl Ipv4Addr { #[must_use] #[inline] pub const fn is_documentation(&self) -> bool { - match self.octets() { - [192, 0, 2, _] => true, - [198, 51, 100, _] => true, - [203, 0, 113, _] => true, - _ => false, - } + matches!(self.octets(), [192, 0, 2, _] | [198, 51, 100, _] | [203, 0, 113, _]) } /// Converts this address to an [IPv4-compatible] [`IPv6` address]. diff --git a/library/std/src/os/unix/net/addr.rs b/library/std/src/os/unix/net/addr.rs index 887f6059939..f450e41bfea 100644 --- a/library/std/src/os/unix/net/addr.rs +++ b/library/std/src/os/unix/net/addr.rs @@ -159,7 +159,7 @@ impl SocketAddr { #[must_use] #[stable(feature = "unix_socket", since = "1.10.0")] pub fn is_unnamed(&self) -> bool { - if let AddressKind::Unnamed = self.address() { true } else { false } + matches!(self.address(), AddressKind::Unnamed) } /// Returns the contents of this address if it is a `pathname` address. |
