diff --git a/binaries/cuprated/src/config.rs b/binaries/cuprated/src/config.rs index 08d38e4c..794b10bf 100644 --- a/binaries/cuprated/src/config.rs +++ b/binaries/cuprated/src/config.rs @@ -33,7 +33,7 @@ pub fn read_config_and_args() -> Config { let config: Config = if let Some(config_file) = &args.config_file { // If a config file was set in the args try to read it and exit if we can't. - match Config::read_from_file(config_file) { + match Config::read_from_path(config_file) { Ok(config) => config, Err(e) => { tracing::error!("Failed to read config from file: {e}"); @@ -44,12 +44,12 @@ pub fn read_config_and_args() -> Config { // First attempt to read the config file from the current directory. std::env::current_dir() .map_err(Into::into) - .and_then(Config::read_from_file) + .and_then(Config::read_from_path) .inspect_err(|e| tracing::debug!("Failed to read config from current dir: {e}")) // otherwise try the main config directory. .or_else(|_| { let file = CUPRATE_CONFIG_DIR.join(DEFAULT_CONFIG_FILE_NAME); - Config::read_from_file(file) + Config::read_from_path(file) }) .inspect_err(|e| { tracing::debug!("Failed to read config from config dir: {e}"); diff --git a/binaries/cuprated/src/config/args.rs b/binaries/cuprated/src/config/args.rs index 9abb3f13..c2cd6233 100644 --- a/binaries/cuprated/src/config/args.rs +++ b/binaries/cuprated/src/config/args.rs @@ -4,7 +4,7 @@ use clap::builder::TypedValueParser; use cuprate_helper::network::Network; -use crate::config::{default::create_default_config_file, Config, DEFAULT_CONFIG_FILE_NAME}; +use crate::config::{default::create_default_config_file, Config}; /// Cuprate Args. #[derive(clap::Parser, Debug)] diff --git a/binaries/cuprated/src/config/default.rs b/binaries/cuprated/src/config/default.rs index 09022ca8..23ca77e9 100644 --- a/binaries/cuprated/src/config/default.rs +++ b/binaries/cuprated/src/config/default.rs @@ -4,9 +4,9 @@ use std::{ str::from_utf8, }; -use cuprate_helper::fs::{CUPRATE_BLOCKCHAIN_DIR, CUPRATE_CACHE_DIR, CUPRATE_TXPOOL_DIR}; - -use crate::config::DEFAULT_CONFIG_FILE_NAME; +use cuprate_helper::fs::{ + CUPRATE_BLOCKCHAIN_DIR, CUPRATE_CACHE_DIR, CUPRATE_TXPOOL_DIR, DEFAULT_CONFIG_FILE_NAME, +}; /// Creates a config file which will be named [`DEFAULT_CONFIG_FILE_NAME`] in the directory given in [`Path`]. ///