write config file if not present
This commit is contained in:
parent
cb7d9082d1
commit
7b5cd0ec70
1 changed files with 5 additions and 1 deletions
|
|
@ -69,7 +69,11 @@ impl Config {
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Config::default()
|
let config = Config::default();
|
||||||
|
if let Err(write_err) = config.save_to_file(filename) {
|
||||||
|
console::log(format!("Error writing config: {:?}", write_err));
|
||||||
|
}
|
||||||
|
return config;
|
||||||
}
|
}
|
||||||
pub fn save_to_file(&self, filename: &str) -> Result<(), Box<dyn std::error::Error>> {
|
pub fn save_to_file(&self, filename: &str) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let toml_string = toml::to_string(self)?;
|
let toml_string = toml::to_string(self)?;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue