MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / drop

Method drop

crates/openshell-core/src/forward.rs:960–967  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

958 #[allow(unsafe_code)] // Tests serialize process-wide environment changes with ENV_LOCK.
959 impl Drop for EnvVarGuard {
960 fn drop(&mut self) {
961 unsafe {
962 match &self.previous {
963 Some(value) => std::env::set_var(self.key, value),
964 None => std::env::remove_var(self.key),
965 }
966 }
967 }
968 }
969
970 #[test]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected