Don't overqualify types that are already imported

This commit is contained in:
Thomas Eizinger 2021-04-16 11:42:24 +10:00
parent 325fcbdb8c
commit be5bf01ed4
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::env::Config;
use crate::protocol::bob;
use crate::{bitcoin, monero};
use anyhow::Result;
use std::sync::Arc;
@ -23,13 +22,13 @@ pub mod swap;
pub struct Swap {
pub state: BobState,
pub event_loop_handle: bob::EventLoopHandle,
pub event_loop_handle: EventLoopHandle,
pub db: Database,
pub bitcoin_wallet: Arc<bitcoin::Wallet>,
pub monero_wallet: Arc<monero::Wallet>,
pub env_config: Config,
pub swap_id: Uuid,
pub receive_monero_address: ::monero::Address,
pub receive_monero_address: monero::Address,
}
pub struct Builder {
@ -44,7 +43,7 @@ pub struct Builder {
event_loop_handle: EventLoopHandle,
receive_monero_address: ::monero::Address,
receive_monero_address: monero::Address,
}
enum InitParams {
@ -61,7 +60,7 @@ impl Builder {
monero_wallet: Arc<monero::Wallet>,
env_config: Config,
event_loop_handle: EventLoopHandle,
receive_monero_address: ::monero::Address,
receive_monero_address: monero::Address,
) -> Self {
Self {
swap_id,
@ -82,7 +81,7 @@ impl Builder {
}
}
pub fn build(self) -> Result<bob::Swap> {
pub fn build(self) -> Result<Swap> {
let state = match self.init_params {
InitParams::New { btc_amount } => BobState::Started { btc_amount },
InitParams::None => self.db.get_state(self.swap_id)?.try_into_bob()?.into(),