error_snippet 0.2.0

Library for reporting fancy diagnostics to the console
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use error_snippet::{Diagnostic, GraphicalRenderer, Renderer};

mod derive;
mod renderer;

fn render(diagnostic: impl Diagnostic) -> String {
    let mut renderer = GraphicalRenderer::new();
    renderer.use_colors = false;

    owo_colors::set_override(false);
    renderer.render(&diagnostic).unwrap().to_string()
}