From a3a561d5fd71c1535387fa18dd26df5f8f82e2b2 Mon Sep 17 00:00:00 2001 From: WelshProgrammer Date: Thu, 1 Aug 2024 17:10:04 +0100 Subject: [PATCH 1/2] fix: Check if the include filter has filters before iteration --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index e2d5d70..b727246 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -275,7 +275,7 @@ impl CopyBuilder { } } - if !self + if !self.include_filters.is_empty() && !self .include_filters .iter() .any(|f| entry.path().to_string_lossy().contains(f)) From 3232c1a8d08acfb29973357e86701f5ef4802659 Mon Sep 17 00:00:00 2001 From: Adam Leyshon Date: Thu, 1 Aug 2024 17:13:24 +0100 Subject: [PATCH 2/2] chore(style): rustfmt --- src/lib.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index b727246..502d491 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -275,10 +275,11 @@ impl CopyBuilder { } } - if !self.include_filters.is_empty() && !self - .include_filters - .iter() - .any(|f| entry.path().to_string_lossy().contains(f)) + if !self.include_filters.is_empty() + && !self + .include_filters + .iter() + .any(|f| entry.path().to_string_lossy().contains(f)) { continue 'files; }