antlr-rust-codegen 0.32.0

ANTLR v4 grammar compiler and Rust source generator
Documentation
1
2
3
4
5
6
7
8
use serde::Serialize;

pub(crate) fn to_pretty_json<T: Serialize>(value: &T) -> String {
    let mut output = serde_json::to_string_pretty(value)
        .expect("JSON model contains only JSON-compatible values");
    output.push('\n');
    output
}