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

Method set

crates/openshell-server/src/defaults.rs:128–133  ·  view source on GitHub ↗
(key: &'static str, value: &Path)

Source from the content-addressed store, hash-verified

126 impl EnvVarGuard {
127 #[allow(unsafe_code)]
128 fn set(key: &'static str, value: &Path) -> Self {
129 let original = std::env::var(key).ok();
130 // SAFETY: tests serialize environment mutation with ENV_LOCK.
131 unsafe { std::env::set_var(key, value) };
132 Self { key, original }
133 }
134 }
135
136 impl Drop for EnvVarGuard {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected