pub fn to_string_pretty<S>(syn: &S) -> String
where S: Syn,
Available on crate feature json only.
Expand description

Serialize the given Syn type as a pretty-printed String of JSON.

This function is equivalent to the following code:

use syn_serde::Syn;

let adapter = syn_file.to_adapter();
serde_json::to_string_pretty(&adapter).unwrap()