Skip to main content

compact_json

Function compact_json 

Source
pub fn compact_json(input: &str) -> Option<String>
Expand description

Compacts a single JSON document by removing insignificant whitespace.

Returns Some(compacted) only when input is valid JSON and the compacted form is strictly smaller. The result is value-identical to the input (only formatting bytes are removed).