Skip to content

Commit

Permalink
fix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
kaplanelad committed Apr 26, 2022
1 parent 30d3c26 commit d32fb1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/collections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ impl TestCaseBuilder {
self.testcase.classname = Some(classname.to_owned());
self
}

/// Set the `file` for the `TestCase`
pub fn set_filepath(&mut self, filepath: &str) -> &mut Self {
self.testcase.filepath = Some(filepath.to_owned());
Expand Down
7 changes: 3 additions & 4 deletions src/reports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,18 @@ impl Report {
//ew.write(XmlEvent::end_element())?;

for tc in &ts.testcases {

let time = format!("{}", tc.time.as_seconds_f64());
let mut testcase_element = XmlEvent::start_element("testcase")
.attr("name", &tc.name)
.attr("time", &time);

if let Some(classname) = &tc.classname {
testcase_element = testcase_element.attr("classname", classname);
}
}

if let Some(filepath) = &tc.filepath {
testcase_element = testcase_element.attr("file", filepath);
}
}

ew.write(testcase_element)?;

Expand Down

0 comments on commit d32fb1d

Please sign in to comment.