diff --git a/Cargo.toml b/Cargo.toml index b8335f9..ead0b65 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,4 +16,5 @@ clap = { version = "4", features = ["deprecated", "derive"] } serde = "1.0.194" serde_derive = "1.0.194" serde_json = "1.0.110" +serde_path_to_error = "0.1" toml = "0.8" diff --git a/src/main.rs b/src/main.rs index 8aab2af..cffb380 100644 --- a/src/main.rs +++ b/src/main.rs @@ -46,7 +46,8 @@ fn do_main() -> Result<()> { process::exit(output.status.code().unwrap_or(1)); } - let metadata: Metadata = serde_json::from_slice(&output.stdout) + let mut json = serde_json::Deserializer::from_slice(&output.stdout); + let metadata: Metadata = serde_path_to_error::deserialize(&mut json) .context("Failed to parse output of `cargo metadata`")?; let mut packages = Map::new();