Skip to content

Commit

Permalink
Use better iter() semantics to collect cfg flags.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhbabon committed Oct 31, 2016
1 parent e100ee9 commit fd8274a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/cargo/ops/cargo_rustc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,9 @@ pub fn compile_targets<'a, 'cfg: 'a>(ws: &Workspace<'cfg>,
}

if let Some(feats) = cx.resolve.features(&unit.pkg.package_id()) {
for feat in feats.iter() {
cx.compilation.cfgs.entry(unit.pkg.package_id().clone())
.or_insert(HashSet::new())
.insert(format!("feature=\"{}\"", feat));
}
cx.compilation.cfgs.entry(unit.pkg.package_id().clone())
.or_insert(HashSet::new())
.extend(feats.iter().map(|feat| format!("feature=\"{}\"", feat)));
}
}

Expand Down

0 comments on commit fd8274a

Please sign in to comment.