Skip to content

Commit

Permalink
move constants out of filter map
Browse files Browse the repository at this point in the history
  • Loading branch information
zerosnacks committed Jul 1, 2024
1 parent 1549542 commit fbee819
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/forge/bin/cmd/coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,11 @@ impl CoverageArgs {
}

// Filter out ignored sources from the report
let file_pattern = filter.args().coverage_pattern_inverse.as_ref();
let file_root = &filter.paths().root;
report.filter_out_ignored_sources(|path: &Path| {
filter.args().coverage_pattern_inverse.as_ref().map_or(true, |re| {
!re.is_match(
&path.strip_prefix(&filter.paths().root).unwrap_or(path).to_string_lossy(),
)
file_pattern.map_or(true, |re| {
!re.is_match(&path.strip_prefix(file_root).unwrap_or(path).to_string_lossy())
})
});

Expand Down

0 comments on commit fbee819

Please sign in to comment.