Skip to content

Commit

Permalink
keep combobox states always up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
GyulyVGC committed Jan 1, 2025
1 parent 1288cf4 commit 2152b51
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/networking/types/host_data_states.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,16 @@ pub struct HostData {
impl HostData {
pub fn update(&mut self, host: &Host) {
if !host.domain.is_empty() && host.domain.parse::<IpAddr>().is_err() {
self.domains.1 = self.domains.0.insert(host.domain.clone());
self.domains.1 = self.domains.0.insert(host.domain.clone()) || self.domains.1;
}

if !host.asn.name.is_empty() {
self.asns.1 = self.asns.0.insert(host.asn.name.clone());
self.asns.1 = self.asns.0.insert(host.asn.name.clone()) || self.asns.1;
}

if host.country != Country::ZZ {
self.countries.1 = self.countries.0.insert(host.country.to_string());
self.countries.1 =
self.countries.0.insert(host.country.to_string()) || self.countries.1;
}
}
}
Expand Down

0 comments on commit 2152b51

Please sign in to comment.