Skip to main content

save_json_pretty

Function save_json_pretty 

Source
pub fn save_json_pretty<P: AsRef<Path>>(path: P, value: &Value) -> Result<()>
Expand description

Serializes value as pretty-printed JSON and writes it to path.

Any existing file at path is overwritten.

ยงErrors

Returns an error if value cannot be serialized to JSON or if the file cannot be written.