mirror of
https://github.com/achanda/ipnetwork.git
synced 2025-06-14 16:26:32 +00:00
fix: use associated constants (#191)
This commit is contained in:
@ -540,7 +540,7 @@ mod test {
|
||||
fn iterator_v4_huge() {
|
||||
let cidr: Ipv4Network = "0/0".parse().unwrap();
|
||||
let mut iter = cidr.iter();
|
||||
for i in 0..(u32::max_value() as u64 + 1) {
|
||||
for i in 0..(u32::MAX as u64 + 1) {
|
||||
assert_eq!(i as u32, u32::from(iter.next().unwrap()));
|
||||
}
|
||||
assert_eq!(None, iter.next());
|
||||
|
@ -129,7 +129,7 @@ impl Ipv6Network {
|
||||
/// This can return up to 2^128 addresses, which will take a _long_ time to iterate over.
|
||||
pub fn iter(&self) -> Ipv6NetworkIterator {
|
||||
let dec = u128::from(self.addr);
|
||||
let max = u128::max_value();
|
||||
let max = u128::MAX;
|
||||
let prefix = self.prefix;
|
||||
|
||||
let mask = max.checked_shl(u32::from(IPV6_BITS - prefix)).unwrap_or(0);
|
||||
|
Reference in New Issue
Block a user