Skip to main content

parse_normal_output

Function parse_normal_output 

Source
pub fn parse_normal_output(output: &str) -> String
Expand description

Parses the output of cargo +nightly rustc --message-format=json -- -Z unpretty=normal and returns the normalized source code.

The output contains JSON messages from cargo (with a “reason” field) interleaved with the unpretty source code. This function filters out the JSON messages and cargo status lines, returning only the source code.