Fix expect message

This commit is contained in:
Paul van Tilburg 2022-02-13 16:55:03 +01:00
parent 79dac18655
commit f6b26c9659
Signed by untrusted user: paul
GPG Key ID: C6DE073EDA9EEC4D
1 changed files with 6 additions and 6 deletions

View File

@ -107,35 +107,35 @@ impl Maps {
impl MapsRefresh for MapsHandle {
fn needs_pollen_refresh(&self) -> bool {
let maps = self.lock().expect("Maps mutex was poisoned");
let maps = self.lock().expect("Maps handle mutex was poisoned");
maps.pollen.is_none() || Instant::now().duration_since(maps.pollen_stamp) > POLLEN_INTERVAL
}
fn needs_precipitation_refresh(&self) -> bool {
let maps = self.lock().expect("Maps mutex was poisoned");
let maps = self.lock().expect("Maps handle mutex was poisoned");
maps.precipitation.iter().any(|map| map.is_none())
|| Instant::now().duration_since(maps.precipitation_stamp) > PRECIPITATION_INTERVAL
}
fn needs_uvi_refresh(&self) -> bool {
let maps = self.lock().expect("Maps mutex was poisoned");
let maps = self.lock().expect("Maps handle mutex was poisoned");
maps.uvi.is_none() || Instant::now().duration_since(maps.uvi_stamp) > UVI_INTERVAL
}
fn set_pollen(&self, pollen: Option<DynamicImage>) {
let mut maps = self.lock().expect("Maps mutex was poisoned");
let mut maps = self.lock().expect("Maps handle mutex was poisoned");
maps.pollen = pollen;
maps.pollen_stamp = Instant::now();
}
fn set_precipitation(&self, precipitation: [Option<DynamicImage>; 24]) {
let mut maps = self.lock().expect("Maps mutex was poisoned");
let mut maps = self.lock().expect("Maps handle mutex was poisoned");
maps.precipitation = precipitation;
maps.precipitation_stamp = Instant::now();
}
fn set_uvi(&self, uvi: Option<DynamicImage>) {
let mut maps = self.lock().expect("Maps mutex was poisoned");
let mut maps = self.lock().expect("Maps handle mutex was poisoned");
maps.uvi = uvi;
maps.uvi_stamp = Instant::now();
}