Remove unwrap in time check

This commit is contained in:
Dheepak Krishnamurthy 2021-06-07 11:40:49 -06:00
parent a054202c1f
commit c0ea57d71e

View file

@ -1334,7 +1334,11 @@ impl TaskwarriorTuiApp {
let mtime = fs::metadata(pending_fp)?.modified()?; let mtime = fs::metadata(pending_fp)?.modified()?;
mtimes.push(mtime); mtimes.push(mtime);
} }
Ok(*mtimes.iter().max().unwrap()) if let Some(t) = mtimes.iter().max() {
Ok(*t)
} else {
Err(anyhow!("Unable to get task files max time"))
}
} }
pub fn tasks_changed_since(&mut self, prev: Option<SystemTime>) -> Result<bool> { pub fn tasks_changed_since(&mut self, prev: Option<SystemTime>) -> Result<bool> {