more refactor checkpoint

This commit is contained in:
John Smith
2022-09-04 15:40:35 -04:00
parent 79cda4a712
commit 75ade4200a
12 changed files with 65 additions and 67 deletions

View File

@@ -57,7 +57,7 @@ pub struct LocalInternetRoutingDomainDetail {
}
impl LocalInternetRoutingDomainDetail {
pub fn set_local_networks(&mut self, local_networks: Vec<(IpAddr, IpAddr)>) -> bool {
pub fn set_local_networks(&mut self, mut local_networks: Vec<(IpAddr, IpAddr)>) -> bool {
local_networks.sort();
if local_networks == self.local_networks {
return false;
@@ -70,7 +70,7 @@ impl LocalInternetRoutingDomainDetail {
impl RoutingDomainDetail for LocalInternetRoutingDomainDetail {
fn can_contain_address(&self, address: Address) -> bool {
let ip = address.to_ip_addr();
for localnet in self.local_networks {
for localnet in &self.local_networks {
if ipaddr_in_network(ip, localnet.0, localnet.1) {
return true;
}