Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cobertura.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ impl CoverageStats {
let lines_valid = lines.len() as f64;

let branches: Vec<Vec<Condition>> = lines
.into_iter()
.filter_map(|(_, l)| match l {
.into_values()
.filter_map(|l| match l {
Line::Branch { conditions, .. } => Some(conditions),
Line::Plain { .. } => None,
})
Expand Down
2 changes: 1 addition & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ pub fn parse_gcov_gz(gcov_path: &Path) -> Result<Vec<(String, CovResult)>, Parse
let mut gcov: GcovJson = serde_json::from_reader(gz).unwrap();
let mut results = Vec::new();

if gcov.format_version != "1" {
if gcov.format_version != "1" && gcov.format_version != "2" {
error!(
"Format version {} is not expected, please file a bug on https://github.com/mozilla/grcov",
gcov.format_version
Expand Down
16 changes: 4 additions & 12 deletions src/path_rewriting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,19 +416,11 @@ pub fn rewrite_paths(
}
}

match filter_option {
Some(true) => {
if !is_covered(&result) {
return None;
}
}
Some(false) => {
if is_covered(&result) {
return None;
}
if let Some(want_covered) = filter_option {
if is_covered(&result) != want_covered {
return None;
}
None => (),
};
}

Some((abs_path, rel_path, result))
});
Expand Down
8 changes: 3 additions & 5 deletions src/producer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,9 @@ impl Archive {
linked_files_maps.borrow_mut().insert(filename, self);
}
}
"out" => {
if Archive::check_file(file, &Archive::is_go_cov) {
let filename = clean_path(path);
self.insert_vec(filename, gocovs);
}
"out" if Archive::check_file(file, &Archive::is_go_cov) => {
let filename = clean_path(path);
self.insert_vec(filename, gocovs);
}
_ => {}
}
Expand Down
Loading