MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / load

Method load

src/user_config.rs:156–164  ·  view source on GitHub ↗

Loads the user-level config file. Returns defaults if the file is missing or unreadable.

()

Source from the content-addressed store, hash-verified

154 /// Loads the user-level config file.
155 /// Returns defaults if the file is missing or unreadable.
156 pub fn load() -> Self {
157 let Some(path) = config_path() else {
158 return Self::default();
159 };
160 let Ok(contents) = std::fs::read_to_string(&path) else {
161 return Self::default();
162 };
163 toml::from_str(&contents).unwrap_or_default()
164 }
165
166 /// Saves the user-level config file. Best-effort.
167 /// Returns true if the file was saved, false on any error.

Callers 6

round_trip_with_timeoutFunction · 0.45
load_reposFunction · 0.45
callsMethod · 0.45
callsMethod · 0.45
loadPluginsFunction · 0.45

Calls 1

config_pathFunction · 0.85

Tested by

no test coverage detected