MCPcopy Create free account
hub / github.com/Roy3838/Observer / load

Method load

cli/src/config.rs:99–108  ·  view source on GitHub ↗

Load config from file, or return default if not found

()

Source from the content-addressed store, hash-verified

97
98 /// Load config from file, or return default if not found
99 pub fn load() -> Self {
100 let Some(path) = Self::config_path() else {
101 return Self::default();
102 };
103
104 match fs::read_to_string(&path) {
105 Ok(contents) => toml::from_str(&contents).unwrap_or_default(),
106 Err(_) => Self::default(),
107 }
108 }
109
110 /// Save config to file
111 pub fn save(&self) -> io::Result<()> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected