Skip to content
Myr

Add newline to JSON output, closes #49

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by sharkdp · committed by sharkdp · parent 0756558 · Browse files · 1 file+6 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−1 removed

  • other:+6 added−1 removed

1 file+6 added−1 removed

modified:src/hyperfine/export/json.rs+6 added-1 removed
12 unmodified lines
13pub struct JsonExporter {}1415impl Exporter for JsonExporter {16 fn serialize(&self, results: &Vec<ExportEntry>) -> Result<Vec<u8>> {17 let mut output = to_vec_pretty(&HyperfineSummary { results });18 for content in output.iter_mut() {19 content.push(b'\n');20 }2117 to_vec_pretty(&HyperfineSummary { results }).map_err(|e| Error::new(ErrorKind::Other, e))22 output.map_err(|e| Error::new(ErrorKind::Other, e))23 }24}