Skip to content

Commit 6c5d258

Browse files
committed
refactor(build-scripts): Use references for creating CARGO_CFG
1 parent bf79c8b commit 6c5d258

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/cargo/core/compiler/custom_build.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,11 @@ fn build_work(build_runner: &mut BuildRunner<'_, '_>, unit: &Unit) -> CargoResul
339339
for cfg in bcx.target_data.cfg(unit.kind) {
340340
match *cfg {
341341
Cfg::Name(ref n) => {
342-
cfg_map.insert(n.clone(), Vec::new());
342+
cfg_map.insert(n.as_str(), Vec::new());
343343
}
344344
Cfg::KeyPair(ref k, ref v) => {
345-
let values = cfg_map.entry(k.clone()).or_default();
346-
values.push(v.clone());
345+
let values = cfg_map.entry(k.as_str()).or_default();
346+
values.push(v.as_str());
347347
}
348348
}
349349
}
@@ -355,7 +355,7 @@ fn build_work(build_runner: &mut BuildRunner<'_, '_>, unit: &Unit) -> CargoResul
355355
}
356356
// FIXME: We should handle raw-idents somehow instead of predenting they
357357
// don't exist here
358-
let k = format!("CARGO_CFG_{}", super::envify(k.as_str()));
358+
let k = format!("CARGO_CFG_{}", super::envify(k));
359359
cmd.env(&k, v.join(","));
360360
}
361361

0 commit comments

Comments
 (0)