summaryrefslogtreecommitdiff
path: root/src/weather_poller.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/weather_poller.rs')
-rw-r--r--src/weather_poller.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/weather_poller.rs b/src/weather_poller.rs
index 4fd418d..6a32661 100644
--- a/src/weather_poller.rs
+++ b/src/weather_poller.rs
@@ -163,7 +163,7 @@ async fn send_ntfy_notification(
};
let client = Client::new();
let _ = client
- .post(&format!("{}/{}", ntfy.server_url, ntfy.topic))
+ .post(format!("{}/{}", ntfy.server_url, ntfy.topic))
.header("Priority", ntfy.priority.to_string())
.header("Title", title)
.body(message)
@@ -202,7 +202,7 @@ async fn send_smtp_notification(
.clone()
.unwrap_or_else(|| "Silmätaivas Alerts".to_string());
let email = Message::builder()
- .from(format!("{} <{}>", from_name, from).parse().unwrap())
+ .from(format!("{from_name} <{from}>").parse().unwrap())
.to(smtp.email.parse().unwrap())
.subject(subject)
.body(body)
@@ -283,8 +283,7 @@ fn default_weather_message(entry: &Value) -> String {
.unwrap_or(0.0);
let time = entry["dt_txt"].as_str().unwrap_or("N/A");
format!(
- "🚨 Weather alert for your location ({}):\n\n🌬️ Wind: {:.1} km/h\n🌧️ Rain: {:.1} mm\n🌡️ Temperature: {:.1} °C\n\nStay safe,\n— Silmätaivas",
- time, wind, rain, temp
+ "🚨 Weather alert for your location ({time}):\n\n🌬️ Wind: {wind:.1} km/h\n🌧️ Rain: {rain:.1} mm\n🌡️ Temperature: {temp:.1} °C\n\nStay safe,\n— Silmätaivas"
)
}