Cargo clippy fixes

This commit is contained in:
Candifloss 2025-11-11 11:55:41 +05:30
parent 4529886370
commit c306dc03fe

View File

@ -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() {