in src/config.rs [1046:1067]
fn load_file_config() -> Result<CachedFileConfig> {
let file_conf_path = &*CACHED_CONFIG_PATH;
if !file_conf_path.exists() {
let file_conf_dir = file_conf_path
.parent()
.expect("Cached conf file has no parent directory");
if !file_conf_dir.is_dir() {
fs::create_dir_all(file_conf_dir)
.context("Failed to create dir to hold cached config")?
}
Self::save_file_config(&Default::default()).with_context(|| {
format!(
"Unable to create cached config file at {}",
file_conf_path.display()
)
})?
}
try_read_config_file(file_conf_path)
.context("Failed to load cached config file")?
.with_context(|| format!("Failed to load from {}", file_conf_path.display()))
}