mirror of
https://github.com/achanda/ipnetwork.git
synced 2025-06-16 08:48:51 +00:00
Simplify network* functions
This commit is contained in:
@ -46,11 +46,11 @@ impl Ipv4Network {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn network_int(&self) -> u32 {
|
pub fn network_int(&self) -> u32 {
|
||||||
u32::from(*(self.ip())) & self.mask_int()
|
u32::from(self.addr)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn network(&self) -> Ipv4Addr {
|
pub fn network(&self) -> Ipv4Addr {
|
||||||
Ipv4Addr::from(self.network_int())
|
self.addr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user