MCPcopy Create free account
hub / github.com/BitVM/BitVM / read_config

Method read_config

bridge/src/client/cli/key_command.rs:169–178  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

167 }
168
169 pub fn read_config(&self) -> io::Result<Config> {
170 if self.config_path.exists() {
171 let mut file = OpenOptions::new().read(true).open(&self.config_path)?;
172 let mut content = String::new();
173 file.read_to_string(&mut content)?;
174 Ok(toml::from_str(&content).unwrap_or_default())
175 } else {
176 Ok(Config::default())
177 }
178 }
179
180 pub fn write_config(&self, config: &Config) -> io::Result<()> {
181 let toml_string = toml::to_string(config).expect("Failed to serialize config");

Callers 2

newMethod · 0.80
handle_commandMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected