fix error

This commit is contained in:
nora 2022-02-25 15:29:56 +01:00 committed by GitHub
parent 85e29a3ae1
commit 97fe43138a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,7 +25,7 @@ impl EventHandler for Handler {
#[tokio::main]
async fn main() {
let file_path = std::env::var("CONFIG_PATH").unwrap_or("./config.json");
let file_path = std::env::var("CONFIG_PATH").unwrap_or_else(|| "./config.json".to_string());
println!("reading config from {file_path}");
let file = fs::read_to_string(file_path).unwrap();
let config = serde_json::from_str::<ConfigFile>(&file).unwrap();