diff --git a/config/src/config.rs b/config/src/config.rs index 98a1ed258..8db451928 100644 --- a/config/src/config.rs +++ b/config/src/config.rs @@ -89,10 +89,8 @@ impl GlobalConfig { Err(ConfigError::FileNotFoundError(String::from(""))) } - /// Takes the path to a config file, or if NONE, tries - /// to determine a config file based on rules in - /// derive_config_location - + /// Takes the path to a config file, or if NONE, tries to determine a config + /// file based on rules in derive_config_location pub fn new(file_path: Option<&str>) -> Result { let mut return_value = GlobalConfig::default(); if let Some(fp) = file_path { @@ -119,14 +117,13 @@ impl GlobalConfig { ))); } - // Try to parse the config file if it exists - // explode if it does exist but something's wrong - // with it + // Try to parse the config file if it exists explode if it does exist but + // something's wrong with it return_value.read_config() } /// Read config - pub fn read_config(mut self) -> Result { + fn read_config(mut self) -> Result { let mut file = File::open(self.config_file_path.as_mut().unwrap())?; let mut contents = String::new(); file.read_to_string(&mut contents)?; diff --git a/src/bin/grin.rs b/src/bin/grin.rs index a57c55f54..e78a41051 100644 --- a/src/bin/grin.rs +++ b/src/bin/grin.rs @@ -378,10 +378,7 @@ fn server_command(server_args: Option<&ArgMatches>, mut global_config: GlobalCon .chain_type, ); } else { - info!( - LOGGER, - "Starting the Grin server (no configuration file) ..." - ); + panic!("No configuration found."); } // just get defaults from the global config