summaryrefslogtreecommitdiff
path: root/src/weather_poller.rs
diff options
context:
space:
mode:
authorDawid Rycerz <dawid@rycerz.xyz>2025-07-14 20:52:55 +0300
committerDawid Rycerz <dawid@rycerz.xyz>2025-07-14 20:52:55 +0300
commiteb0c5d947a2e2755fac4a9b34d9dee6c2987afbb (patch)
tree6c423fe456a3cee24e292ee24b609b08dc6704e4 /src/weather_poller.rs
parent1c2873b3059f3e4d6bd02307ec5b22f761ce1c80 (diff)
feat: Add dockerfile and docker-compose
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"
)
}