json.rs
This file
Path
src/export/json.rs
27 lines · 637 bytes · Rust
Last changed by
Fix clippy suggestionsDavid Peterbefore adoptionc7e5694
History of this fileTake it
The walk stopped after 200 commits: lines older than cd8e4f4 point at it.
Bump libc from 0.2.106 to 0.2.108dependabot[bot]before adoptioncd8e4f4
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.106 to 0.2.108dependabot[bot]before adoptioncd8e4f4
line 7why, one step back7Unified error handlingDavid Peterbefore adoption2040810
lines 8–9why, one step back8use anyhow::Result;9Bump libc from 0.2.106 to 0.2.108dependabot[bot]before adoptioncd8e4f4
lines 10–20why, 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 });Fix clippy suggestionsDavid Peterbefore adoptionc7e5694
line 21why, one step back21 if let Ok(ref mut content) = output {Bump libc from 0.2.106 to 0.2.108dependabot[bot]before adoptioncd8e4f4
lines 22–24why, one step back22 content.push(b'\n');23 }24Unified error handlingDavid Peterbefore adoption2040810
line 25why, one step back25 Ok(output?)Bump libc from 0.2.106 to 0.2.108dependabot[bot]before adoptioncd8e4f4
lines 26–27why, one step back26 }27}