Skip to main content

format_source

Function format_source 

Source
pub fn format_source(source: &str, unit: &SourceUnit) -> String
Expand description

Formats unit, which must be the tree parsed from source.

Reading the source alongside the tree is what lets the formatter keep comments, blank lines, and the exact spelling of numeric and string literals.