Skip to main content

parse_cargo_metadata

Function parse_cargo_metadata 

fn parse_cargo_metadata(bytes: &[u8]) -> Result<CargoMetadata, Error>
Expand description

Decodes the metadata shape this checker consumes.

Cargo emits a large document, but the target directory is the only field whose value this command needs. Parsing the complete JSON value first is important: a target path can contain quotes, backslashes, spaces and Unicode, all of which must be decoded according to JSON’s rules rather than by string splitting.