From f0c96c28bf2fa1576c55d42350e0041724a36f3c Mon Sep 17 00:00:00 2001 From: Nutomic Date: Mon, 5 Apr 2021 14:23:32 +0000 Subject: [PATCH] Crash if config fails to load (#1545) * Crash if config fails to load * fix previous commit --- crates/utils/src/settings/mod.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/crates/utils/src/settings/mod.rs b/crates/utils/src/settings/mod.rs index 0990a43de..d052fec6c 100644 --- a/crates/utils/src/settings/mod.rs +++ b/crates/utils/src/settings/mod.rs @@ -13,7 +13,6 @@ use crate::{ }; use anyhow::{anyhow, Context}; use deser_hjson::from_str; -use log::warn; use merge::Merge; use std::{env, fs, io::Error, net::IpAddr, sync::RwLock}; @@ -23,16 +22,8 @@ pub mod structs; static CONFIG_FILE: &str = "config/config.hjson"; lazy_static! { - static ref SETTINGS: RwLock = RwLock::new(match Settings::init() { - Ok(c) => c, - Err(e) => { - warn!( - "Couldn't load settings file, using default settings.\n{}", - e - ); - Settings::default() - } - }); + static ref SETTINGS: RwLock = + RwLock::new(Settings::init().expect("Failed to load settings file")); } impl Settings {