Skip to content

Commit

Permalink
Remove CommandEnv::apply
Browse files Browse the repository at this point in the history
It's not being used and uses unsound set_var and remove_var
functions.
  • Loading branch information
KamilaBorowska committed Dec 29, 2021
1 parent 8e05bb5 commit 14fc9dc
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions library/std/src/sys_common/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,6 @@ impl CommandEnv {
result
}

// Apply these changes directly to the current environment
pub fn apply(&self) {
if self.clear {
for (k, _) in env::vars_os() {
env::remove_var(k);
}
}
for (key, maybe_val) in self.vars.iter() {
if let Some(ref val) = maybe_val {
env::set_var(key, val);
} else {
env::remove_var(key);
}
}
}

pub fn is_unchanged(&self) -> bool {
!self.clear && self.vars.is_empty()
}
Expand Down

0 comments on commit 14fc9dc

Please sign in to comment.