MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / load

Method load

crates/opencode-tui/src/context/app_context.rs:369–383  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

367
368impl 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) {

Callers

nothing calls this directly

Calls 1

ui_kv_pathFunction · 0.85

Tested by

no test coverage detected