[][src]Function papyrus::fmt::format

pub fn format(code_snippet: &str) -> Result<String, FormatError>

Format a code snippet using an external rustfmt call.

Example

let src = "fn a_b(  s: & str) -> String {   String::new(  )  }";
let fmtd = papyrus::fmt::format(src).unwrap();
assert_eq!(&fmtd, r#"fn a_b(s: &str) -> String {
    String::new()
}"#);