mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 17:00:18 +00:00
Unified error handling
This commit is contained in:
1 parent
34dabcbed7
commit
2040810ce3
10 files changed
+95
-101
No files matched your search
+3
-4
@@ -1,5 +1,4 @@
|
||||
use std::borrow::Cow;
|
||||
use std::io::{Error, ErrorKind, Result};
|
||||
|
||||
use csv::WriterBuilder;
|
||||
|
||||
@@ -7,6 +6,8 @@ use super::Exporter;
|
||||
use crate::benchmark_result::BenchmarkResult;
|
||||
use crate::units::Unit;
|
||||
|
||||
use anyhow::Result;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct CsvExporter {}
|
||||
|
||||
@@ -49,9 +50,7 @@ impl Exporter for CsvExporter {
|
||||
writer.write_record(fields)?;
|
||||
}
|
||||
|
||||
writer
|
||||
.into_inner()
|
||||
.map_err(|e| Error::new(ErrorKind::Other, e))
|
||||
Ok(writer.into_inner()?)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user