Unified error handling

This commit is contained in:
David Peter authored and David Peter committed 2022-02-06 20:19:50 +01:00
1 parent 34dabcbed7
commit 2040810ce3
10 files changed
+95 -101

No files matched your search

+3 -3
View File
@@ -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?)
}
}