fix(config): skip empty patterns in `file_filter`

My NixOS module inserts these and I'm too lazy to fix this in Nix
This commit is contained in:
Harsh Shandilya 2023-12-24 00:47:26 +05:30
parent 1808f0484d
commit 6ad513cc1b
1 changed files with 4 additions and 2 deletions

View File

@ -21,8 +21,10 @@ pub struct Bucket<'bucket> {
impl<'a> Root<'a> {
pub fn is_match(&self, file_name: &str) -> bool {
if let Some(pattern) = self.bucket.file_filter {
if let Ok(glob) = Glob::new(pattern) {
return glob.compile_matcher().is_match(file_name);
if !pattern.is_empty() {
if let Ok(glob) = Glob::new(pattern) {
return glob.compile_matcher().is_match(file_name);
}
}
};
true