From b55751f2c06d8c403ff3605540f2b5de6530fa99 Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Thu, 26 Dec 2019 20:15:32 -0600 Subject: [PATCH] fix nathan's problem --- src/ops/empty.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ops/empty.rs b/src/ops/empty.rs index 6d86f4b..482e975 100644 --- a/src/ops/empty.rs +++ b/src/ops/empty.rs @@ -25,10 +25,12 @@ pub fn empty(dry: bool, days: Option) -> Result<()> { println!("{:?}", file.path); } else { fs::remove_file(file.info_path)?; - if file.deleted_path.is_dir() { - fs::remove_dir_all(file.deleted_path)?; - } else { - fs::remove_file(file.deleted_path)?; + if file.deleted_path.exists() { + if file.deleted_path.is_dir() { + fs::remove_dir_all(file.deleted_path)?; + } else { + fs::remove_file(file.deleted_path)?; + } } } }