From eb0c5d947a2e2755fac4a9b34d9dee6c2987afbb Mon Sep 17 00:00:00 2001 From: Dawid Rycerz Date: Mon, 14 Jul 2025 20:52:55 +0300 Subject: feat: Add dockerfile and docker-compose --- src/weather_poller.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/weather_poller.rs') 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" ) } -- cgit v1.2.3