Skip to main content

nd_300/render/
json.rs

1use crate::config::Config;
2use crate::diagnostics::DiagnosticResults;
3
4pub fn render(results: &DiagnosticResults, _config: &Config) -> String {
5    match serde_json::to_string_pretty(results) {
6        Ok(json) => format!("{}\n", json),
7        Err(e) => {
8            let fallback = serde_json::json!({
9                "error": format!("Failed to serialize results: {}", e)
10            });
11            format!("{}\n", fallback)
12        }
13    }
14}