Skip to content

Commit

Permalink
Fix optional dependency check when crate is renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
nbdd0121 committed Nov 15, 2023
1 parent 6d35ac1 commit a927450
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crate_universe/src/metadata/dependency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ fn is_optional_crate_enabled(
.filter(|&d| d.kind == kind)
.filter(|&d| d.target.as_ref() == target)
.filter(|&d| d.optional)
.find(|&d| sanitize_module_name(&d.name) == dep.name)
.find(|&d| sanitize_module_name(d.rename.as_ref().unwrap_or(&d.name)) == dep.name)
{
enabled_deps.any(|d| d == toml_dep.name.as_str())
enabled_deps.any(|d| d == toml_dep.rename.as_ref().unwrap_or(&toml_dep.name))
} else {
true
}
Expand Down

0 comments on commit a927450

Please sign in to comment.