Skip to main content

format_code

Function format_code 

Source
pub fn format_code(code: &str) -> Result<String, Error>
Expand description

Format generated Rust code using rustfmt.

ยงErrors

  • Error::Io - Spawning or communicating with the rustfmt process failed.
  • Error::InvalidUtf8 - rustfmt produced output that was not valid UTF-8.