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

Method drop

crates/openshell-cli/tests/helpers/mod.rs:56–69  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

54#[allow(unsafe_code)]
55impl Drop for EnvVarGuard {
56 fn drop(&mut self) {
57 for var in &self.vars {
58 if let Some(value) = &var.original {
59 unsafe {
60 std::env::set_var(var.key, value);
61 }
62 } else {
63 unsafe {
64 std::env::remove_var(var.key);
65 }
66 }
67 }
68 // _lock drops here, releasing the mutex
69 }
70}
71
72// ── TLS helpers ──────────────────────────────────────────────────────────────

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected