Skip to content

Commit

Permalink
♻️ remove variable decl that became obsolete after optional struct up…
Browse files Browse the repository at this point in the history
…date
  • Loading branch information
ttytm committed Aug 23, 2024
1 parent 012b313 commit 81ee7f9
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/modules/display/historical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = &params.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::<usize>().unwrap_or_default(),
sunset[0][11..13].parse::<usize>().unwrap_or_default(),
Expand All @@ -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 {
Expand Down

0 comments on commit 81ee7f9

Please sign in to comment.