fix new Rust 1.95 clippy lints

This commit is contained in:
GyulyVGC
2026-04-16 23:58:09 +02:00
parent b719ce48d6
commit 8365353d56
5 changed files with 8 additions and 8 deletions

View File

@@ -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)
}
}

View File

@@ -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(),

View File

@@ -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);
}

View File

@@ -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))
}
}
}

View File

@@ -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})")
}
}