json.rs
This file
Path
src/export/json.rs
27 lines · 634 bytes · Rust
Last changed by
Move functionality to schedulerDavid Peterbefore adoptiondcfeede
History of this fileTake it
The walk stopped after 200 commits: lines older than b44890b point at it.
Bump libc from 0.2.104 to 0.2.106dependabot[bot]before adoptionb44890b
lines 1–4why, one step back1use serde::*;2use serde_json::to_vec_pretty;34use super::Exporter;Move functionality to schedulerDavid Peterbefore adoptiondcfeede
line 5why, one step back5use crate::benchmark::benchmark_result::BenchmarkResult;Move a few modules to utilDavid Peterbefore adoption5c634c9
line 6why, one step back6use crate::util::units::Unit;Bump libc from 0.2.104 to 0.2.106dependabot[bot]before adoptionb44890b
line 7why, one step back7Unified error handlingDavid Peterbefore adoption2040810
lines 8–9why, one step back8use anyhow::Result;9Bump libc from 0.2.104 to 0.2.106dependabot[bot]before adoptionb44890b
lines 10–24why, one step back10#[derive(Serialize, Debug)]11struct HyperfineSummary<'a> {12 results: &'a [BenchmarkResult],13}1415#[derive(Default)]16pub struct JsonExporter {}1718impl Exporter for JsonExporter {19 fn serialize(&self, results: &[BenchmarkResult], _unit: Option<Unit>) -> Result<Vec<u8>> {20 let mut output = to_vec_pretty(&HyperfineSummary { results });21 for content in output.iter_mut() {22 content.push(b'\n');23 }24Unified error handlingDavid Peterbefore adoption2040810
line 25why, one step back25 Ok(output?)Bump libc from 0.2.104 to 0.2.106dependabot[bot]before adoptionb44890b
lines 26–27why, one step back26 }27}