(&self, key: K)
| 85 | } |
| 86 | |
| 87 | pub fn get_os<K: AsRef<OsStr>>(&self, key: K) -> Option<OsString> { |
| 88 | use inner::Inner; |
| 89 | match &self.0 { |
| 90 | Inner::Real => env::var_os(key.as_ref()), |
| 91 | Inner::Fake(fake) => fake |
| 92 | .lock() |
| 93 | .unwrap() |
| 94 | .vars |
| 95 | .get(key.as_ref().to_str()?) |
| 96 | .cloned() |
| 97 | .map(OsString::from), |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | /// Sets the environment variable `key` to the value `value` for the currently running |
| 102 | /// process. |
no test coverage detected