Skip to content

Commit

Permalink
Simplify is_broadcast
Browse files Browse the repository at this point in the history
  • Loading branch information
faern committed Jul 30, 2018
1 parent 798680a commit 312cdb4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/libstd/net/ip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,7 @@ impl Ipv4Addr {
/// ```
#[stable(since = "1.7.0", feature = "ip_17")]
pub fn is_broadcast(&self) -> bool {
self.octets()[0] == 255 && self.octets()[1] == 255 &&
self.octets()[2] == 255 && self.octets()[3] == 255
self == &Self::BROADCAST
}

/// Returns [`true`] if this address is in a range designated for documentation.
Expand Down

0 comments on commit 312cdb4

Please sign in to comment.