mirror of
https://github.com/Cuprate/cuprate.git
synced 2024-12-22 19:49:28 +00:00
fix imports
This commit is contained in:
parent
26653d428d
commit
352dac694f
3 changed files with 7 additions and 7 deletions
|
@ -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}");
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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`].
|
||||
///
|
||||
|
|
Loading…
Reference in a new issue