Add newline to JSON output, closes #49

This commit is contained in:
sharkdp committed 2018-03-21 22:56:01 +01:00
1 parent 0756558d53
commit 3351f52b1b
1 file changed
+6 -1
+6 -1
View File
@@ -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))
}
}