Skip to content

Commit

Permalink
Handle error properly
Browse files Browse the repository at this point in the history
  • Loading branch information
illicitonion committed Aug 8, 2024
1 parent 309781a commit a138e5a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions crate_universe/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ impl TreeResolver {
.manifest_path(pristine_manifest_path)
.exec()
.context("Failed to run cargo metadata to list transitive proc macros")?;
let proc_macros: BTreeSet<_> = cargo_metadata
let proc_macros = cargo_metadata
.packages
.iter()
.filter(|p| {
Expand All @@ -724,15 +724,20 @@ impl TreeResolver {
..cargo_toml::DependencyDetail::default()
});

let source = Source::parse(&source.repr, pm.version.to_string()).expect("TODO");
let source = match Source::parse(&source.repr, pm.version.to_string()) {
Ok(source) => source,
Err(err) => {
return Some(Err(err));
}
};
source.populate_details(&mut detail.0);

Some((pm.name.clone(), detail))
Some(Ok((pm.name.clone(), detail)))
} else {
None
}
})
.collect();
.collect::<Result<BTreeSet<_>>>()?;

let mut manifest =
cargo_toml::Manifest::from_path(pristine_manifest_path).with_context(|| {
Expand Down

0 comments on commit a138e5a

Please sign in to comment.