Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ipv4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl Ipv4Network {

/// Checks if the given `Ipv4Network` is a subnet of the other.
pub fn is_subnet_of(self, other: Ipv4Network) -> bool {
other.ip() <= self.ip() && other.broadcast() >= self.broadcast()
other.network() <= self.network() && other.broadcast() >= self.broadcast()
}

/// Checks if the given `Ipv4Network` is a supernet of the other.
Expand Down
2 changes: 1 addition & 1 deletion src/ipv6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl Ipv6Network {

/// Checks if the given `Ipv6Network` is a subnet of the other.
pub fn is_subnet_of(self, other: Ipv6Network) -> bool {
other.ip() <= self.ip() && other.broadcast() >= self.broadcast()
other.network() <= self.network() && other.broadcast() >= self.broadcast()
}

/// Checks if the given `Ipv6Network` is a supernet of the other.
Expand Down