swt 5.0.0-rc.10

🍬 Sweet: A blazing-fast code health and architecture analyzer.
Documentation
1
2
3
4
5
6
7
8
9
10
use serde::Serialize;
use std::fs;
use std::path::Path;

/// Write the analysis report to a JSON file.
pub fn write_json_report<T: Serialize + ?Sized>(reports: &T, path: &Path) {
    if let Ok(json) = serde_json::to_string_pretty(reports) {
        let _ = fs::write(path, json);
    }
}