Be smart about how we import Config

By saying env::Config, we can save a line of code in the imports
and make it clearer, what kind of `Config` this is.
This commit is contained in:
Thomas Eizinger 2021-04-16 11:45:05 +10:00
parent be5bf01ed4
commit 7adeaae12d
No known key found for this signature in database
GPG key ID: 651AC83A6C6C8B96

View file

@ -1,6 +1,5 @@
use crate::database::Database; use crate::database::Database;
use crate::env::Config; use crate::{bitcoin, env, monero};
use crate::{bitcoin, monero};
use anyhow::Result; use anyhow::Result;
use std::sync::Arc; use std::sync::Arc;
use uuid::Uuid; use uuid::Uuid;
@ -26,7 +25,7 @@ pub struct Swap {
pub db: Database, pub db: Database,
pub bitcoin_wallet: Arc<bitcoin::Wallet>, pub bitcoin_wallet: Arc<bitcoin::Wallet>,
pub monero_wallet: Arc<monero::Wallet>, pub monero_wallet: Arc<monero::Wallet>,
pub env_config: Config, pub env_config: env::Config,
pub swap_id: Uuid, pub swap_id: Uuid,
pub receive_monero_address: monero::Address, pub receive_monero_address: monero::Address,
} }
@ -39,7 +38,7 @@ pub struct Builder {
monero_wallet: Arc<monero::Wallet>, monero_wallet: Arc<monero::Wallet>,
init_params: InitParams, init_params: InitParams,
env_config: Config, env_config: env::Config,
event_loop_handle: EventLoopHandle, event_loop_handle: EventLoopHandle,
@ -58,7 +57,7 @@ impl Builder {
swap_id: Uuid, swap_id: Uuid,
bitcoin_wallet: Arc<bitcoin::Wallet>, bitcoin_wallet: Arc<bitcoin::Wallet>,
monero_wallet: Arc<monero::Wallet>, monero_wallet: Arc<monero::Wallet>,
env_config: Config, env_config: env::Config,
event_loop_handle: EventLoopHandle, event_loop_handle: EventLoopHandle,
receive_monero_address: monero::Address, receive_monero_address: monero::Address,
) -> Self { ) -> Self {