From 869635778719609d8b5023ff509f076ffaea0633 Mon Sep 17 00:00:00 2001 From: Dimitris Date: Fri, 12 Jun 2026 11:39:17 +0200 Subject: [PATCH] Coordinates as const --- src/main.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index bc97090..6a1a2cd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,11 +9,15 @@ use tokio::{task, time}; const METEO_MUNICH_API_URL: &str = "https://www.meteorologie.lmu.de/~quicklooks/aktuelle_messwerte/messwerte_stadt.html"; +const LATITUDE_MUC: f64 = 48.163142; + +const LONGITUDE_MUC: f64 = 11.542922; + #[tokio::main(flavor = "current_thread")] async fn main() { let (client, mut eventloop) = create_conn(); - match meteo_weather(48.163142, 11.542922).await { + match meteo_weather().await { Ok(weather) => { task::spawn(async move { publish(client.clone(), &weather).await; @@ -42,7 +46,7 @@ async fn main() { } } -pub async fn meteo_weather(latitude: f64, longitude: f64) -> Result { +pub async fn meteo_weather() -> Result { let response = trpl::get(METEO_MUNICH_API_URL).await; let response_text = response.text().await; @@ -104,7 +108,7 @@ pub async fn meteo_weather(latitude: f64, longitude: f64) -> Result