diagprint 0.5.0

Pretty, structured diagnostics and reports for Rust applications.
Documentation
1
2
3
4
5
6
7
8
9
use super::Renderer;
use crate::Diagnostic;
#[derive(Debug, Default, Clone, Copy)]
pub struct JsonRenderer;
impl Renderer for JsonRenderer {
    fn render(&self, d: &Diagnostic) -> String {
        serde_json::to_string_pretty(d).expect("diagnostic serialization failed")
    }
}