mirror of
https://github.com/achanda/ipnetwork.git
synced 2025-06-18 01:38:51 +00:00
Use cargo clippy --fix to autofix code
This commit is contained in:

committed by
Abhishek Chanda

parent
dff59ea0a5
commit
b624487f72
10
src/ipv4.rs
10
src/ipv4.rs
@ -194,7 +194,7 @@ impl Ipv4Network {
|
||||
/// ```
|
||||
#[inline]
|
||||
pub fn contains(&self, ip: Ipv4Addr) -> bool {
|
||||
let mask = !(0xffff_ffff as u64 >> self.prefix) as u32;
|
||||
let mask = !(0xffff_ffff_u64 >> self.prefix) as u32;
|
||||
let net = u32::from(self.addr) & mask;
|
||||
(u32::from(ip) & mask) == net
|
||||
}
|
||||
@ -614,9 +614,7 @@ mod test {
|
||||
assert_eq!(
|
||||
src.is_subnet_of(dest),
|
||||
*val,
|
||||
"testing with {} and {}",
|
||||
src,
|
||||
dest
|
||||
"testing with {src} and {dest}"
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -659,9 +657,7 @@ mod test {
|
||||
assert_eq!(
|
||||
src.is_supernet_of(dest),
|
||||
*val,
|
||||
"testing with {} and {}",
|
||||
src,
|
||||
dest
|
||||
"testing with {src} and {dest}"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user