nd300 3.0.8

Cross-platform network diagnostic tool
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::config::Config;
use crate::diagnostics::DiagnosticResults;

pub fn render(results: &DiagnosticResults, _config: &Config) -> String {
    match serde_json::to_string_pretty(results) {
        Ok(json) => format!("{}\n", json),
        Err(e) => {
            let fallback = serde_json::json!({
                "error": format!("Failed to serialize results: {}", e)
            });
            format!("{}\n", fallback)
        }
    }
}