Skip to content

Commit

Permalink
Preserve optional deps when creating features in the expanded crate
Browse files Browse the repository at this point in the history
  • Loading branch information
antalsz committed Jul 2, 2024
1 parent ac96ed9 commit 448c320
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,17 @@ fn make_manifest(

let features = source_manifest
.features
.keys()
.map(|feature| {
.iter()
.map(|(feature, source_deps)| {
let enable = format!("{}/{}", crate_name, feature);
(feature.clone(), vec![enable])
let mut deps = vec![enable];
deps.extend(
source_deps
.iter()
.filter(|dep| dep.starts_with("dep:"))
.cloned(),
);
(feature.clone(), deps)
})
.collect();

Expand Down

0 comments on commit 448c320

Please sign in to comment.