diff --git a/src/networking/manage_packets.rs b/src/networking/manage_packets.rs index 6040743b..f45c5426 100644 --- a/src/networking/manage_packets.rs +++ b/src/networking/manage_packets.rs @@ -10,7 +10,6 @@ use pcap::{Active, Address, Capture, Device}; use crate::countries::country_utils::get_country; use crate::networking::types::address_port_pair::AddressPortPair; use crate::networking::types::app_protocol::from_port_to_application_protocol; -use crate::networking::types::data_info::DataInfo; use crate::networking::types::data_info_host::DataInfoHost; use crate::networking::types::filters::Filters; use crate::networking::types::host::Host; @@ -285,7 +284,7 @@ pub fn reverse_dns_lookup( let other_data = info_traffic_lock .addresses_waiting_resolution .remove(&address_to_lookup) - .unwrap_or(DataInfo::default()); + .unwrap_or_default(); // insert the newly resolved host in the collections, with the data it exchanged so far info_traffic_lock .addresses_resolved diff --git a/src/notifications/types/notifications.rs b/src/notifications/types/notifications.rs index e3eff629..6d6f6b41 100644 --- a/src/notifications/types/notifications.rs +++ b/src/notifications/types/notifications.rs @@ -58,7 +58,7 @@ impl Default for PacketsNotification { impl PacketsNotification { /// Arbitrary string constructor. Will fallback values to existing notification if set, default() otherwise pub fn from(value: &str, existing: Option) -> Self { - let default = existing.unwrap_or(Self::default()); + let default = existing.unwrap_or_default(); let new_threshold = if value.is_empty() { 0 @@ -99,7 +99,7 @@ impl Default for BytesNotification { impl BytesNotification { /// Arbitrary string constructor. Will fallback values to existing notification if set, default() otherwise pub fn from(value: &str, existing: Option) -> Self { - let default = existing.unwrap_or(Self::default()); + let default = existing.unwrap_or_default(); let mut byte_multiple_inserted = ByteMultiple::B; let new_threshold = if value.is_empty() {