Rename config_path to path to avoid duplication

This commit is contained in:
Daniel Karzel 2021-01-29 14:29:30 +11:00
parent 2adfd89ffd
commit 79a0f53745
2 changed files with 5 additions and 5 deletions

View file

@ -86,7 +86,7 @@ pub struct Config {
help = "Provide a custom path to the configuration file. The configuration file must be a toml file.", help = "Provide a custom path to the configuration file. The configuration file must be a toml file.",
parse(from_os_str) parse(from_os_str)
)] )]
pub config_path: Option<PathBuf>, pub path: Option<PathBuf>,
} }
fn parse_btc(str: &str) -> anyhow::Result<bitcoin::Amount> { fn parse_btc(str: &str) -> anyhow::Result<bitcoin::Amount> {

View file

@ -77,7 +77,7 @@ async fn main() -> Result<()> {
receive_bitcoin, receive_bitcoin,
config, config,
} => { } => {
let settings = init_settings(config.config_path)?; let settings = init_settings(config.path)?;
let swap_amounts = SwapAmounts { let swap_amounts = SwapAmounts {
xmr: send_monero, xmr: send_monero,
@ -116,7 +116,7 @@ async fn main() -> Result<()> {
receive_monero, receive_monero,
config, config,
} => { } => {
let settings = init_settings(config.config_path)?; let settings = init_settings(config.path)?;
let swap_amounts = SwapAmounts { let swap_amounts = SwapAmounts {
btc: send_bitcoin, btc: send_bitcoin,
@ -166,7 +166,7 @@ async fn main() -> Result<()> {
listen_addr, listen_addr,
config, config,
}) => { }) => {
let settings = init_settings(config.config_path)?; let settings = init_settings(config.path)?;
let (bitcoin_wallet, monero_wallet) = init_wallets(settings.wallets).await?; let (bitcoin_wallet, monero_wallet) = init_wallets(settings.wallets).await?;
@ -191,7 +191,7 @@ async fn main() -> Result<()> {
alice_addr, alice_addr,
config, config,
}) => { }) => {
let settings = init_settings(config.config_path)?; let settings = init_settings(config.path)?;
let (bitcoin_wallet, monero_wallet) = init_wallets(settings.wallets).await?; let (bitcoin_wallet, monero_wallet) = init_wallets(settings.wallets).await?;