Skip to content

Commit

Permalink
Don't enforce the dep_spec source matching the source for the resolve…
Browse files Browse the repository at this point in the history
…d package

With [patch] sections, this may not be the case.
  • Loading branch information
g2p committed May 27, 2024
1 parent 872e8b5 commit a21f5cf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/search_unused.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,10 @@ pub(crate) fn find_unused(
.expect(
"resolved dependencies should appear under cargo-metadata packages",
);
let mut dep_spec_it = root_package.dependencies.iter().filter(|dep_spec| {
dep_spec.name == dep_pkg.name
&& dep_spec.source.as_ref() == dep_pkg.source.as_ref().map(|s| &s.repr)
});
let mut dep_spec_it = root_package
.dependencies
.iter()
.filter(|dep_spec| dep_spec.name == dep_pkg.name);
// The dependency can appear more than once, for example if it is both
// a dependency and a dev-dependency (often with more features enabled).
// We'll assume cargo enforces consistency.
Expand Down

0 comments on commit a21f5cf

Please sign in to comment.