From 99008ac03eb6f8411d20f83f388835b14ef45b97 Mon Sep 17 00:00:00 2001 From: Inanna Malick Date: Sun, 13 Aug 2023 14:46:09 -0700 Subject: [PATCH] minimize scope of changes by reverting change to settings.rs --- veilid-cli/src/main.rs | 2 +- veilid-cli/src/settings.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/veilid-cli/src/main.rs b/veilid-cli/src/main.rs index f1448bd3..02c78631 100644 --- a/veilid-cli/src/main.rs +++ b/veilid-cli/src/main.rs @@ -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 diff --git a/veilid-cli/src/settings.rs b/veilid-cli/src/settings.rs index a34b14ff..5cc9268f 100644 --- a/veilid-cli/src/settings.rs +++ b/veilid-cli/src/settings.rs @@ -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) -> Result { + pub fn new(config_file: Option<&OsStr>) -> Result { // 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)?; }