Skip to content
Snippets Groups Projects
Verified Commit 15ab26aa authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

make Clippy happy

parent c5b2b06f
No related branches found
No related tags found
No related merge requests found
Pipeline #9106 passed
......@@ -70,29 +70,35 @@ impl Bencher {
}
fn dump(&self, label: &str, times: &[u128], append: bool) {
let output = format!("{}", label! { label: label, name: self.name, times: times });
let output = label! { label: label, name: self.name, times: times }.to_string();
if let Some(path) = &self.file {
create_dir_all(path.parent().unwrap()).expect(&format!(
create_dir_all(path.parent().unwrap()).unwrap_or_else(|_| {
panic!(
"{}: could not create parent directory of log file '{}'",
self.name,
path.to_str().unwrap()
));
)
});
let mut f = File::options()
.write(true)
.append(append)
.truncate(!append)
.create(true)
.open(path)
.expect(&format!(
.unwrap_or_else(|_| {
panic!(
"{}: could not open log file '{}'",
self.name,
path.to_str().unwrap()
));
writeln!(&mut f, "{}", output).expect(&format!(
)
});
writeln!(&mut f, "{}", output).unwrap_or_else(|_| {
panic!(
"{}: could not write to log file '{}'",
self.name,
path.to_str().unwrap()
));
)
});
} else {
println!("{}", output);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment