Tests serialize process-wide environment changes with ENV_LOCK.
(key: &'static str, value: &std::path::Path)
| 947 | impl EnvVarGuard { |
| 948 | #[allow(unsafe_code)] // Tests serialize process-wide environment changes with ENV_LOCK. |
| 949 | fn set_path(key: &'static str, value: &std::path::Path) -> Self { |
| 950 | let previous = std::env::var_os(key); |
| 951 | unsafe { |
| 952 | std::env::set_var(key, value); |
| 953 | } |
| 954 | Self { key, previous } |
| 955 | } |
| 956 | } |
| 957 | |
| 958 | #[allow(unsafe_code)] // Tests serialize process-wide environment changes with ENV_LOCK. |