(key: &'static str, value: impl AsRef<OsStr>)
| 32 | |
| 33 | impl EnvVarGuard { |
| 34 | pub fn set(key: &'static str, value: impl AsRef<OsStr>) -> Self { |
| 35 | let previous = std::env::var_os(key); |
| 36 | std::env::set_var(key, value); |
| 37 | Self { key, previous } |
| 38 | } |
| 39 | |
| 40 | /// Removes `key` for the guard's lifetime, so tests can exercise the |
| 41 | /// no-override path. |