mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 08:50:19 +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
-3
@@ -1,5 +1,3 @@
|
||||
use std::io::{Error, ErrorKind, Result};
|
||||
|
||||
use serde::*;
|
||||
use serde_json::to_vec_pretty;
|
||||
|
||||
@@ -7,6 +5,8 @@ use super::Exporter;
|
||||
use crate::benchmark_result::BenchmarkResult;
|
||||
use crate::units::Unit;
|
||||
|
||||
use anyhow::Result;
|
||||
|
||||
#[derive(Serialize, Debug)]
|
||||
struct HyperfineSummary<'a> {
|
||||
results: &'a [BenchmarkResult],
|
||||
@@ -22,6 +22,6 @@ impl Exporter for JsonExporter {
|
||||
content.push(b'\n');
|
||||
}
|
||||
|
||||
output.map_err(|e| Error::new(ErrorKind::Other, e))
|
||||
Ok(output?)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user