mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 08:50:19 +00:00
Add newline to JSON output, closes #49
This commit is contained in:
1 parent
0756558d53
commit
3351f52b1b
1 file changed
+6
-1
@@ -14,6 +14,11 @@ pub struct JsonExporter {}
|
||||
|
||||
impl Exporter for JsonExporter {
|
||||
fn serialize(&self, results: &Vec<ExportEntry>) -> Result<Vec<u8>> {
|
||||
to_vec_pretty(&HyperfineSummary { results }).map_err(|e| Error::new(ErrorKind::Other, e))
|
||||
let mut output = to_vec_pretty(&HyperfineSummary { results });
|
||||
for content in output.iter_mut() {
|
||||
content.push(b'\n');
|
||||
}
|
||||
|
||||
output.map_err(|e| Error::new(ErrorKind::Other, e))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user