Skip to main content

format_content

Function format_content 

Source
pub fn format_content(
    path: &Path,
    content: &str,
    cfg: &FormatConfig,
) -> Result<Option<String>>
Expand description

Format a single file’s content. Returns Ok(Some(formatted)) if the content changed, Ok(None) if already formatted, or Err on parse failure.

§Errors

Returns an error if the file content cannot be parsed.