From 3a174ca3f2b3d61c5f5f0366d33d63c9711d159a Mon Sep 17 00:00:00 2001 From: Emre Sahin Date: Fri, 13 Dec 2024 21:27:49 +0300 Subject: [PATCH] fix a bug when cd cannot be found --- file/src/remove/mod.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/file/src/remove/mod.rs b/file/src/remove/mod.rs index 3a3e00b9..48b63487 100644 --- a/file/src/remove/mod.rs +++ b/file/src/remove/mod.rs @@ -140,11 +140,10 @@ pub fn cmd_remove(output_snd: &XvcOutputSender, xvc_root: &XvcRoot, opts: Remove } else { remove_targets .iter() - .map(|(xe, xp)| { - ( - *xe, - XvcCachePath::new(xp, all_content_digests.get(xe).unwrap()).unwrap(), - ) + .filter_map(|(xe, xp)| { + all_content_digests + .get(xe) + .map(|cd| (*xe, XvcCachePath::new(xp, cd).unwrap())) }) .collect::>() };