()
| 367 | |
| 368 | impl UiKv { |
| 369 | fn load() -> Self { |
| 370 | let Some(path) = ui_kv_path() else { |
| 371 | return Self::default(); |
| 372 | }; |
| 373 | |
| 374 | let values = fs::read_to_string(&path) |
| 375 | .ok() |
| 376 | .and_then(|content| serde_json::from_str::<HashMap<String, Value>>(&content).ok()) |
| 377 | .unwrap_or_default(); |
| 378 | |
| 379 | Self { |
| 380 | path: Some(path), |
| 381 | values, |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | fn get_bool(&self, key: &str, default: bool) -> bool { |
| 386 | match self.values.get(key) { |
nothing calls this directly
no test coverage detected