Skip to main content

write_value_pretty

Function write_value_pretty 

Source
pub fn write_value_pretty<T: ToJson + ?Sized>(out: &mut String, value: &T)
Expand description

Appends value to out as indented JSON (see to_string_pretty).

ยงExamples

use jsonx_lib::{json, write_value_pretty};

let mut out = String::new();
write_value_pretty(&mut out, &json!([1]));
assert_eq!(out, "[\n  1\n]");