main #2

Merged
heavyweaponsgal merged 2 commits from slonk/bingus-blog:main into main 2024-05-04 15:21:57 +03:00
Showing only changes of commit 95cd0323a2 - Show all commits

View file

@ -139,8 +139,11 @@ impl Default for CacheConfig {
}
pub async fn load() -> Result<Config> {
let config_file = env::var(format!("{}_CONFIG", env!("CARGO_BIN_NAME")))
.unwrap_or(String::from("config.toml"));
let config_file = env::var(format!(
"{}_CONFIG",
env!("CARGO_BIN_NAME").to_uppercase().replace("-", "_")
))
.unwrap_or(String::from("config.toml"));
match tokio::fs::OpenOptions::new()
.read(true)
.open(&config_file)