(key_path: &str)
| 144 | } |
| 145 | |
| 146 | fn remove_key(key_path: &str) -> Result<(), RegistryError> { |
| 147 | match RegistryKey::new(key_path) { |
| 148 | Ok(key) => { |
| 149 | key.delete(true)?; |
| 150 | Ok(()) |
| 151 | }, |
| 152 | Err(NtStatusError { status: NtStatusErrorKind::ObjectNameNotFound, ..}) => { |
| 153 | Ok(()) // key doesn't exist, so we're good |
| 154 | } |
| 155 | Err(err) => { |
| 156 | Err(RegistryError::NtStatus(err)) |
| 157 | } |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | fn open_or_create_key(key_path: &str) -> Result<RegistryKey, RegistryError> { |
| 162 | let reg_key: RegistryKey; |
no test coverage detected