From f38cac0ce540493f288c0ccda5a3a48107c921d7 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Tue, 12 Oct 2021 13:49:02 +1100 Subject: [PATCH] Refer to types within `fmt` module via module qualifier --- daemon/src/model.rs | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/daemon/src/model.rs b/daemon/src/model.rs index 98b8df4..f51f46f 100644 --- a/daemon/src/model.rs +++ b/daemon/src/model.rs @@ -1,12 +1,9 @@ -use std::fmt::{Display, Formatter}; - use anyhow::{Context, Result}; +use bdk::bitcoin::{Address, Amount}; +use reqwest::Url; use rust_decimal::prelude::ToPrimitive; use rust_decimal::Decimal; use serde::{Deserialize, Serialize}; - -use bdk::bitcoin::{Address, Amount}; -use reqwest::Url; use std::fmt; use std::str::FromStr; use std::time::SystemTime; @@ -46,8 +43,8 @@ impl Usd { } } -impl Display for Usd { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { +impl fmt::Display for Usd { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.0.fmt(f) } } @@ -61,8 +58,8 @@ impl From for Usd { #[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq)] pub struct Percent(pub Decimal); -impl Display for Percent { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { +impl fmt::Display for Percent { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.0.round_dp(2).fmt(f) } } @@ -96,8 +93,8 @@ impl Default for TakerId { } } -impl Display for TakerId { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { +impl fmt::Display for TakerId { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.0.fmt(f) } } @@ -121,8 +118,8 @@ impl BitMexPriceEventId { } } -impl Display for BitMexPriceEventId { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { +impl fmt::Display for BitMexPriceEventId { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.0.fmt(f) } }