mirror of
https://gitlab.com/veilid/veilid.git
synced 2024-10-01 01:26:08 -04:00
minimize scope of changes by reverting change to settings.rs
This commit is contained in:
parent
e9e362d4bd
commit
99008ac03e
@ -58,7 +58,7 @@ fn main() -> Result<(), String> {
|
||||
None
|
||||
};
|
||||
|
||||
let mut settings = settings::Settings::new(settings_path)
|
||||
let mut settings = settings::Settings::new(settings_path.as_ref().map(|x| x.as_os_str()))
|
||||
.map_err(|e| format!("configuration is invalid: {}", e))?;
|
||||
|
||||
// Set config from command line
|
||||
|
@ -1,7 +1,7 @@
|
||||
use directories::*;
|
||||
|
||||
use serde_derive::*;
|
||||
use std::ffi::OsString;
|
||||
use std::ffi::OsStr;
|
||||
use std::net::{SocketAddr, ToSocketAddrs};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
@ -234,13 +234,13 @@ impl Settings {
|
||||
default_log_directory
|
||||
}
|
||||
|
||||
pub fn new(config_file: Option<OsString>) -> Result<Self, config::ConfigError> {
|
||||
pub fn new(config_file: Option<&OsStr>) -> Result<Self, config::ConfigError> {
|
||||
// Load the default config
|
||||
let mut cfg = load_default_config()?;
|
||||
|
||||
// Merge in the config file if we have one
|
||||
if let Some(config_file) = config_file {
|
||||
let config_file_path = Path::new(&config_file);
|
||||
let config_file_path = Path::new(config_file);
|
||||
// If the user specifies a config file on the command line then it must exist
|
||||
cfg = load_config(cfg, config_file_path)?;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user