We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 72e6b9d commit a071c3aCopy full SHA for a071c3a
src/cargo/core/compiler/build_plan.rs
@@ -73,19 +73,20 @@ impl Invocation {
73
self.program = cmd.get_program()
74
.to_str()
75
.ok_or_else(|| format_err!("unicode program string required"))?
76
- .to_string()
77
- .clone();
+ .to_string();
78
self.cwd = Some(cmd.get_cwd().unwrap().to_path_buf());
79
for arg in cmd.get_args().iter() {
80
self.args.push(
81
arg.to_str()
82
.ok_or_else(|| format_err!("unicode argument string required"))?
83
84
- .clone(),
+ .to_string(),
85
);
86
}
87
- for var in cmd.get_envs().keys() {
88
- let value = cmd.get_env(var).unwrap_or_default();
+ for (var, value) in cmd.get_envs() {
+ let value = match value {
+ Some(s) => s,
+ None => continue,
89
+ };
90
self.env.insert(
91
var.clone(),
92
value
0 commit comments