Skip to content

Commit

Permalink
use matches! in library/std/src/net/ip.rs
Browse files Browse the repository at this point in the history
Apply suggestion from review

Co-authored-by: LingMan <LingMan@users.noreply.github.com>
  • Loading branch information
wcampbell0x2a and LingMan committed Oct 13, 2020
1 parent 7a75f44 commit 7da0e58
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions library/std/src/net/ip.rs
Expand Up @@ -1259,10 +1259,7 @@ impl Ipv6Addr {
/// [RFC 4291 errata 4406]: https://www.rfc-editor.org/errata/eid4406
#[rustc_const_unstable(feature = "const_ipv6", issue = "76205")]
pub const fn is_unicast_link_local_strict(&self) -> bool {
(self.segments()[0]) == 0xfe80
&& self.segments()[1] == 0
&& self.segments()[2] == 0
&& self.segments()[3] == 0
matches!(self.segments(), [0xfe80, 0, 0, 0, ..])
}

/// Returns [`true`] if the address is a unicast link-local address (`fe80::/10`).
Expand Down

0 comments on commit 7da0e58

Please sign in to comment.