Crash if config fails to load (#1545)

* Crash if config fails to load

* fix previous commit
pull/1551/head
Nutomic 3 years ago committed by GitHub
parent ebb980eaaf
commit f0c96c28bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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<Settings> = 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<Settings> =
RwLock::new(Settings::init().expect("Failed to load settings file"));
}
impl Settings {

Loading…
Cancel
Save