diff --git a/widget/src/show_popup.rs b/widget/src/show_popup.rs index c3521f7..5078095 100644 --- a/widget/src/show_popup.rs +++ b/widget/src/show_popup.rs @@ -1,11 +1,10 @@ use iced::{ - Alignment, Background, Border, Color, Font, Length, Point, Settings, Shadow, Size, Task, - Vector, + Background, Border, Color, Font, Length, Point, Shadow, Size, Task, alignment::{Horizontal, Vertical}, application::Appearance, border, font::Family, - widget::{Column, Container, Row, Text, container}, + widget::{Column, Row, Text, container}, window, }; use owm_rs::free_api_v25::current::WeatherResponse; @@ -41,8 +40,9 @@ impl WeatherPopup { .resp .weather .first() - .map(|w| (w.main.clone(), w.description.clone(), w.icon.clone())) - .unwrap_or(("N/A".into(), "N/A".into(), String::new())); + .map_or(("N/A".into(), "N/A".into(), String::new()), |w| { + (w.main.clone(), w.description.clone(), w.icon.clone()) + }); let temp = self.resp.main.as_ref().and_then(|m| m.temp).unwrap_or(0.0); let temperature = format!("{temp:.1}"); let unit = match self.conf.query_params.units.as_str() {