Skip to content

Commit 219269a

Browse files
authored
Merge pull request #9 from giovannimirarchi420/fix/include-filters
Improved handling of multiple patterns in include_filters (dircpy issue #8)
2 parents 5d11e6b + e309613 commit 219269a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/lib.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,12 @@ impl CopyBuilder {
275275
}
276276
}
277277

278-
for f in &self.include_filters {
279-
if !entry.path().to_string_lossy().contains(f) {
280-
continue 'files;
281-
}
278+
if !self
279+
.include_filters
280+
.iter()
281+
.any(|f| entry.path().to_string_lossy().contains(f))
282+
{
283+
continue 'files;
282284
}
283285

284286
// File is not present: copy it in any case

0 commit comments

Comments
 (0)