(&self)
| 21 | |
| 22 | impl RefreshEnv { |
| 23 | pub fn set(&self) { |
| 24 | #[cfg(windows)] |
| 25 | { |
| 26 | // Set the environment variable in the registry for current user |
| 27 | let hkcu = Hive::CurrentUser.open("Environment", Security::Write).unwrap(); |
| 28 | let ucstring = UCString::<u16>::from_str(&self.value).unwrap(); |
| 29 | let data = Data::String(ucstring); |
| 30 | hkcu.set_value(&self.name, &data).unwrap(); |
| 31 | } |
| 32 | #[cfg(not(windows))] |
| 33 | { |
| 34 | // Do nothing on non-Windows |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | pub fn get(&self) -> RefreshEnv { |
| 39 | #[cfg(windows)] |