Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bram209 committed Aug 1, 2024
1 parent 374d25a commit e54391e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,10 @@ fn as_glob_pattern(pattern: String) -> String {
pattern
}

fn get_file_paths(input_patterns: Vec<String>, exclude_patterns: Vec<String>) -> Result<Vec<PathBuf>, GlobError> {
fn get_file_paths(
input_patterns: Vec<String>,
exclude_patterns: Vec<String>,
) -> Result<Vec<PathBuf>, GlobError> {
let exclude_patterns = exclude_patterns
.into_iter()
.map(as_glob_pattern)
Expand All @@ -214,7 +217,11 @@ fn get_file_paths(input_patterns: Vec<String>, exclude_patterns: Vec<String>) ->
glob(&glob_pattern)
.expect("failed to read glob pattern")
.filter(|is_file| {
is_file.as_ref().is_ok_and(|file| !exclude_patterns.iter().any(|pattern| pattern.matches_path(file)))
is_file.as_ref().is_ok_and(|file| {
!exclude_patterns
.iter()
.any(|pattern| pattern.matches_path(file))
})
})
})
.collect()
Expand Down

0 comments on commit e54391e

Please sign in to comment.