From 45522b86dfe48616e1718be286918c3cfcc6e279 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Thu, 8 Feb 2018 21:34:11 +0200 Subject: [PATCH] Remove another unwrap. Though it would never be hit currently. --- hammond-data/src/utils.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hammond-data/src/utils.rs b/hammond-data/src/utils.rs index 5681686..5ce5e66 100644 --- a/hammond-data/src/utils.rs +++ b/hammond-data/src/utils.rs @@ -20,7 +20,12 @@ fn download_checker() -> Result<(), DataError> { episodes .par_iter_mut() - .filter(|ep| !Path::new(ep.local_uri().unwrap()).exists()) + .filter_map(|ep| { + if !Path::new(ep.local_uri()?).exists() { + return Some(ep); + } + None + }) .for_each(|ep| { ep.set_local_uri(None); if let Err(err) = ep.save() {