From 81ee7f94fe12fa639f8a51e3a8ff98ce63cfce65 Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Fri, 23 Aug 2024 20:47:52 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20remove=20variable=20decl?= =?UTF-8?q?=20that=20became=20obsolete=20after=20optional=20struct=20updat?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/display/historical.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/modules/display/historical.rs b/src/modules/display/historical.rs index 92d0e8d..c33f1a1 100644 --- a/src/modules/display/historical.rs +++ b/src/modules/display/historical.rs @@ -130,12 +130,11 @@ impl HistoricalWeather { // Helpers let weather = &product.historical_weather.as_ref().unwrap()[date]; - let weather_daily = &weather.daily; let weather_daily_units = weather.daily_units.as_ref().unwrap(); let lang = ¶ms.config.language; // Times - let sunrise = weather_daily.sunrise.as_ref().unwrap(); - let sunset = weather_daily.sunset.as_ref().unwrap(); + let sunrise = weather.daily.sunrise.as_ref().unwrap(); + let sunset = weather.daily.sunset.as_ref().unwrap(); let (sunrise_hour, sunset_hour) = ( sunrise[0][11..13].parse::().unwrap_or_default(), sunset[0][11..13].parse::().unwrap_or_default(), @@ -152,20 +151,20 @@ impl HistoricalWeather { }; let temp_max_min = format!( "{:.1}/{:.1}{}", - weather_daily.temperature_2m_max.as_ref().unwrap()[0], - weather_daily.temperature_2m_min.as_ref().unwrap()[0], + weather.daily.temperature_2m_max.as_ref().unwrap()[0], + weather.daily.temperature_2m_min.as_ref().unwrap()[0], weather_daily_units.temperature_2m_max, ); let apparent_temp_max_min = format!( "{} {:.1}/{:.1}{}", params.texts.weather.felt_like, - weather_daily.apparent_temperature_max.as_ref().unwrap()[0], - weather_daily.apparent_temperature_min.as_ref().unwrap()[0], + weather.daily.apparent_temperature_max.as_ref().unwrap()[0], + weather.daily.apparent_temperature_min.as_ref().unwrap()[0], weather_daily_units.temperature_2m_max, ); let precipitation_sum = format!( "❲{}{}❳", - weather_daily.precipitation_sum.as_ref().unwrap()[0], + weather.daily.precipitation_sum.as_ref().unwrap()[0], if params.config.units.precipitation == Precipitation::inch { "ᵢₙ" } else {