fix: clippy lint on format

This commit is contained in:
2025-08-10 16:48:56 +02:00
parent 33e1423dee
commit dac46a1652
2 changed files with 4 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ impl AlertFormatter {
("Swap", "CRITICAL") => "Swap saturated - Performance degraded!".to_string(),
("Disk", "WARNING") => "Low disk space".to_string(),
("Disk", "CRITICAL") => "Disk almost full - Urgent cleanup required!".to_string(),
(metric, _) => format!("Level '{}' problem detected on {}", level, metric),
(metric, _) => format!("Level '{level}' problem detected on {metric}"),
}
}
}
@@ -44,7 +44,7 @@ impl ForFormattingMessage for AlertFormatter {
result.push_str(
&metrics
.iter()
.map(|(key, value)| format!("{}: {:.1}%", key, value))
.map(|(key, value)| format!("{key}: {value:.1}%"))
.collect::<Vec<_>>()
.join("\n"),
);

View File

@@ -47,12 +47,12 @@ fn main() {
match cli.command {
Commands::Run => {
if let Err(e) = service.alert_on_threshold_violation() {
eprintln!("Error during threshold violation check: {}", e);
eprintln!("Error during threshold violation check: {e}");
}
}
Commands::Get => {
if let Err(e) = service.send_all_metrics_notification() {
eprintln!("Error sending final notification: {}", e);
eprintln!("Error sending final notification: {e}");
}
}
}