fix: clippy lint on format
This commit is contained in:
@@ -15,7 +15,7 @@ impl AlertFormatter {
|
|||||||
("Swap", "CRITICAL") => "Swap saturated - Performance degraded!".to_string(),
|
("Swap", "CRITICAL") => "Swap saturated - Performance degraded!".to_string(),
|
||||||
("Disk", "WARNING") => "Low disk space".to_string(),
|
("Disk", "WARNING") => "Low disk space".to_string(),
|
||||||
("Disk", "CRITICAL") => "Disk almost full - Urgent cleanup required!".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(
|
result.push_str(
|
||||||
&metrics
|
&metrics
|
||||||
.iter()
|
.iter()
|
||||||
.map(|(key, value)| format!("{}: {:.1}%", key, value))
|
.map(|(key, value)| format!("{key}: {value:.1}%"))
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
.join("\n"),
|
.join("\n"),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -47,12 +47,12 @@ fn main() {
|
|||||||
match cli.command {
|
match cli.command {
|
||||||
Commands::Run => {
|
Commands::Run => {
|
||||||
if let Err(e) = service.alert_on_threshold_violation() {
|
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 => {
|
Commands::Get => {
|
||||||
if let Err(e) = service.send_all_metrics_notification() {
|
if let Err(e) = service.send_all_metrics_notification() {
|
||||||
eprintln!("Error sending final notification: {}", e);
|
eprintln!("Error sending final notification: {e}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user