From b07d6940e16967a64e00171150182db5b17e7535 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 15 Jun 2025 22:13:41 +0300 Subject: [PATCH] do not skip errors --- src/storage.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/storage.rs b/src/storage.rs index 83318aa..fab8975 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -56,10 +56,8 @@ impl Storage { /// Recursively remove all files under the `infohash` location /// that do not match the `skip_filename` (see rqbit#408) pub fn cleanup(&self, infohash: &str, skip_filename: Option<®ex::Regex>) -> Result<()> { - for e in walkdir::WalkDir::new(self.output_folder(infohash, false)?) - .into_iter() - .filter_map(Result::ok) - { + for e in walkdir::WalkDir::new(self.output_folder(infohash, false)?) { + let e = e?; let p = e.path(); if p.is_file() && skip_filename.is_none_or(|r| !r.is_match(p.to_str().unwrap())) { fs::remove_file(p)?;