From 7120a1f70aad255337d4d344aac4b27e59601d23 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 21 Jun 2021 12:14:02 +1000 Subject: [PATCH] Don't depend on `core::fmt` through `bitcoin_hashes` re-export --- swap/src/database/alice.rs | 6 +++--- swap/src/database/bob.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/swap/src/database/alice.rs b/swap/src/database/alice.rs index 80c0d0d4..3c62c006 100644 --- a/swap/src/database/alice.rs +++ b/swap/src/database/alice.rs @@ -3,9 +3,9 @@ use crate::monero; use crate::monero::{monero_private_key, TransferProof}; use crate::protocol::alice; use crate::protocol::alice::AliceState; -use ::bitcoin::hashes::core::fmt::Display; use monero_rpc::wallet::BlockHeight; use serde::{Deserialize, Serialize}; +use std::fmt; // Large enum variant is fine because this is only used for database // and is dropped once written in DB. @@ -274,8 +274,8 @@ impl From for AliceState { } } -impl Display for Alice { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl fmt::Display for Alice { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Alice::Started { .. } => write!(f, "Started"), Alice::BtcLocked { .. } => f.write_str("Bitcoin locked"), diff --git a/swap/src/database/bob.rs b/swap/src/database/bob.rs index 322e21ba..bbd5b6a0 100644 --- a/swap/src/database/bob.rs +++ b/swap/src/database/bob.rs @@ -1,9 +1,9 @@ use crate::monero::TransferProof; use crate::protocol::bob; use crate::protocol::bob::BobState; -use ::bitcoin::hashes::core::fmt::Display; use monero_rpc::wallet::BlockHeight; use serde::{Deserialize, Serialize}; +use std::fmt; #[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] pub enum Bob { @@ -104,8 +104,8 @@ impl From for BobState { } } -impl Display for Bob { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl fmt::Display for Bob { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Bob::Started { .. } => write!(f, "Started"), Bob::ExecutionSetupDone { .. } => f.write_str("Execution setup done"),