cache-lens 0.1.0

A static analyzer that detects cache-unfriendly Array-of-Structures (AoS) usage in Rust and suggests Structure-of-Arrays (SoA) refactors.
1
2
3
4
5
6
7
8
9
10
use anyhow::{Context, Result};

use crate::model::Finding;

pub fn print_json_report(findings: &[Finding]) -> Result<()> {
    let json =
        serde_json::to_string_pretty(findings).context("failed to serialize findings to JSON")?;
    println!("{json}");
    Ok(())
}