]> git.proxmox.com Git - cargo.git/commitdiff
Use better iter() semantics to collect cfg flags.
authorJuan Hernández <juan.hernandez.babon@gmail.com>
Mon, 31 Oct 2016 22:54:04 +0000 (23:54 +0100)
committerJuan Hernández <juan.hernandez.babon@gmail.com>
Mon, 31 Oct 2016 22:54:04 +0000 (23:54 +0100)
src/cargo/ops/cargo_rustc/mod.rs

index 26edaae9e4fae10e0b35d10692c9f8c8eda1ab87..00bcb866282a295458735f5559f338ee6918cb1c 100644 (file)
@@ -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)));
         }
     }