mirror of
https://github.com/helix-editor/helix.git
synced 2025-04-05 03:47:51 +03:00
allow class lines to be optional in coverage xml
This commit is contained in:
parent
e8aa25e332
commit
aa144e68c6
1 changed files with 5 additions and 3 deletions
|
@ -60,7 +60,7 @@ struct Class {
|
|||
name: String,
|
||||
#[serde(rename = "@filename")]
|
||||
filename: String,
|
||||
lines: Lines,
|
||||
lines: Option<Lines>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
|
@ -148,8 +148,10 @@ impl From<RawCoverage> for Coverage {
|
|||
for package in coverage.packages.package {
|
||||
for class in package.classes.class {
|
||||
let mut lines = HashMap::new();
|
||||
for line in class.lines.line {
|
||||
lines.insert(line.number - 1, line.hits > 0);
|
||||
if let Some(class_lines) = class.lines {
|
||||
for line in class_lines.line {
|
||||
lines.insert(line.number - 1, line.hits > 0);
|
||||
}
|
||||
}
|
||||
for source in &coverage.sources.source {
|
||||
// it is ambiguous to which source a coverage class might belong
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue