Fix clippy for Rust 1.95

This commit is contained in:
Markus Unterwaditzer
2026-04-16 21:11:44 +02:00
committed by Brad Warren
parent a1a29b5ec8
commit ca30a146b2
4 changed files with 19 additions and 23 deletions

View File

@@ -289,19 +289,17 @@ impl DiagTask {
self.stop(qmdl_store, Some(reason)).await;
return;
}
DiskSpaceCheck::Warning(mb) => {
if !self.low_space_warned {
self.low_space_warned = true;
warn!("Disk space low: {}MB remaining", mb);
self.notification_channel
.send(Notification::new(
NotificationType::Warning,
format!("Disk space low: {}MB free", mb),
Some(Duration::from_secs(30)),
))
.await
.ok();
}
DiskSpaceCheck::Warning(mb) if !self.low_space_warned => {
self.low_space_warned = true;
warn!("Disk space low: {}MB remaining", mb);
self.notification_channel
.send(Notification::new(
NotificationType::Warning,
format!("Disk space low: {}MB free", mb),
Some(Duration::from_secs(30)),
))
.await
.ok();
}
_ => {}
}

View File

@@ -216,7 +216,7 @@ impl RecordingStore {
}
// sort chronologically
manifest_entries.sort_by(|a, b| a.start_time.cmp(&b.start_time));
manifest_entries.sort_by_key(|a| a.start_time);
let mut store = RecordingStore {
path: path.as_ref().to_path_buf(),

View File

@@ -81,11 +81,12 @@ impl DiskStats {
let free_kb = (stat.f_bfree as u64 * block_size / 1024) as usize;
let available_kb = (stat.f_bavail as u64 * block_size / 1024) as usize;
let used_kb = total_kb.saturating_sub(free_kb);
let used_percent = if stat.f_blocks > 0 {
format!("{}%", (stat.f_blocks - stat.f_bfree) * 100 / stat.f_blocks)
} else {
"0%".to_string()
};
let used_percent = format!(
"{}%",
((stat.f_blocks - stat.f_bfree) * 100)
.checked_div(stat.f_blocks)
.unwrap_or(0)
);
Ok(Self {
partition: qmdl_path.to_string(),

View File

@@ -42,10 +42,7 @@ pub async fn telnet_send_command_with_output(
let mut read_buf = Vec::new();
timeout(Duration::from_secs(10), async {
loop {
let Ok(byte) = reader.read_u8().await else {
break;
};
while let Ok(byte) = reader.read_u8().await {
read_buf.push(byte);
// when we see this string we know the command is done and can terminate.