Skip to main content

prettyprint

Function prettyprint 

Source
pub fn prettyprint(src: &str) -> String
Expand description

The first pass of rustfmt: hoist long paths into imports and pretty-print src with prettyplease, keeping its leading banner.

prettyplease normalizes spacing and breaks lines rustfmt would otherwise give up on. If the body does not parse (a real codegen bug), this function returns src unchanged, so the rustfmt pass surfaces the precise error.