Skip to content

Commit 14fc9dc

Browse files
Remove CommandEnv::apply
It's not being used and uses unsound set_var and remove_var functions.
1 parent 8e05bb5 commit 14fc9dc

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

Diff for: library/std/src/sys_common/process.rs

-16
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,6 @@ impl CommandEnv {
3939
result
4040
}
4141

42-
// Apply these changes directly to the current environment
43-
pub fn apply(&self) {
44-
if self.clear {
45-
for (k, _) in env::vars_os() {
46-
env::remove_var(k);
47-
}
48-
}
49-
for (key, maybe_val) in self.vars.iter() {
50-
if let Some(ref val) = maybe_val {
51-
env::set_var(key, val);
52-
} else {
53-
env::remove_var(key);
54-
}
55-
}
56-
}
57-
5842
pub fn is_unchanged(&self) -> bool {
5943
!self.clear && self.vars.is_empty()
6044
}

0 commit comments

Comments
 (0)