mirror of
https://github.com/GyulyVGC/sniffnet.git
synced 2026-04-17 20:57:48 -04:00
fix new Rust 1.95 clippy lints
This commit is contained in:
@@ -264,7 +264,7 @@ fn time_subscription(&self) -> Subscription<Message> {
|
||||
sub.map(|_| Message::Quit)
|
||||
}
|
||||
} else {
|
||||
iced::time::every(Duration::from_millis(1000)).map(|_| Message::Periodic)
|
||||
iced::time::every(Duration::from_secs(1)).map(|_| Message::Periodic)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ pub fn parse_packets(
|
||||
let mut pending_hosts = Vec::new();
|
||||
while !resolutions_state.addresses_waiting_resolution.is_empty() {
|
||||
pending_hosts.extend(resolutions_state.new_hosts_to_send());
|
||||
thread::sleep(Duration::from_millis(1000));
|
||||
thread::sleep(Duration::from_secs(1));
|
||||
}
|
||||
// send one last message including all pending hosts
|
||||
let _ = tx
|
||||
@@ -479,9 +479,9 @@ fn maybe_send_tick_run_live(
|
||||
tx: &Sender<BackendTrafficMessage>,
|
||||
resolutions_state: &mut AddressesResolutionState,
|
||||
) {
|
||||
if first_packet_ticks.is_some_and(|i| i.elapsed() >= Duration::from_millis(1000)) {
|
||||
if first_packet_ticks.is_some_and(|i| i.elapsed() >= Duration::from_secs(1)) {
|
||||
*first_packet_ticks =
|
||||
first_packet_ticks.and_then(|i| i.checked_add(Duration::from_millis(1000)));
|
||||
first_packet_ticks.and_then(|i| i.checked_add(Duration::from_secs(1)));
|
||||
let _ = tx.send_blocking(BackendTrafficMessage::TickRun(
|
||||
cap_id,
|
||||
info_traffic_msg.take_but_leave_something(),
|
||||
|
||||
@@ -35,9 +35,9 @@ pub fn traffic_preview(tx: &Sender<TrafficPreview>) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ticks.elapsed() >= Duration::from_millis(1000) {
|
||||
if ticks.elapsed() >= Duration::from_secs(1) {
|
||||
ticks = ticks
|
||||
.checked_add(Duration::from_millis(1000))
|
||||
.checked_add(Duration::from_secs(1))
|
||||
.unwrap_or(Instant::now());
|
||||
handle_devices_and_previews(&mut data, tx, &pcap_tx);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ pub fn full_print_on_one_line(self, language: Language) -> String {
|
||||
)
|
||||
}
|
||||
Self::NotYetAssigned => {
|
||||
format!("{}: -", link_type_translation(language),)
|
||||
format!("{}: -", link_type_translation(language))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,6 @@ fn borrow(&self) -> &ServiceQuery {
|
||||
impl phf_shared::FmtConst for ServiceQuery {
|
||||
fn fmt_const(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
||||
let ServiceQuery(port, protocol) = self;
|
||||
write!(f, "ServiceQuery({port}, Protocol::{protocol})",)
|
||||
write!(f, "ServiceQuery({port}, Protocol::{protocol})")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user