From b03cf15806dbe6acb150b623101ed500f40b9ee9 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 27 Feb 2024 14:13:59 -0800 Subject: [PATCH] Remove unnecessary lifetime from Formatter --- crates/ordinals/src/rarity.rs | 2 +- crates/ordinals/src/sat.rs | 4 ++-- src/decimal.rs | 2 +- src/index/reorg.rs | 2 +- src/inscriptions/media.rs | 14 +++++++------- src/outgoing.rs | 2 +- src/wallet/transaction_builder.rs | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/crates/ordinals/src/rarity.rs b/crates/ordinals/src/rarity.rs index f62b708cc0..eb98e15dc4 100644 --- a/crates/ordinals/src/rarity.rs +++ b/crates/ordinals/src/rarity.rs @@ -33,7 +33,7 @@ impl TryFrom for Rarity { } impl Display for Rarity { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { write!( f, "{}", diff --git a/crates/ordinals/src/sat.rs b/crates/ordinals/src/sat.rs index 4c4dbc775e..1665d2cd22 100644 --- a/crates/ordinals/src/sat.rs +++ b/crates/ordinals/src/sat.rs @@ -229,7 +229,7 @@ pub struct Error { } impl Display for Error { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { write!(f, "failed to parse sat `{}`: {}", self.input, self.kind) } } @@ -263,7 +263,7 @@ impl ErrorKind { } impl Display for ErrorKind { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { match self { Self::IntegerRange => write!(f, "invalid integer range"), Self::NameRange => write!(f, "invalid name range"), diff --git a/src/decimal.rs b/src/decimal.rs index b20593bfe3..f66b533ddc 100644 --- a/src/decimal.rs +++ b/src/decimal.rs @@ -25,7 +25,7 @@ impl Decimal { } impl Display for Decimal { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { let magnitude = 10u128.pow(self.scale.into()); let integer = self.value / magnitude; diff --git a/src/index/reorg.rs b/src/index/reorg.rs index 9337103f96..c69cfdada9 100644 --- a/src/index/reorg.rs +++ b/src/index/reorg.rs @@ -7,7 +7,7 @@ pub(crate) enum ReorgError { } impl Display for ReorgError { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { match self { ReorgError::Recoverable { height, depth } => { write!(f, "{depth} block deep reorg detected at height {height}") diff --git a/src/inscriptions/media.rs b/src/inscriptions/media.rs index f61833e99a..de41de2571 100644 --- a/src/inscriptions/media.rs +++ b/src/inscriptions/media.rs @@ -38,11 +38,11 @@ impl Display for Language { f, "{}", match self { - Css => "css", - JavaScript => "javascript", - Json => "json", - Python => "python", - Yaml => "yaml", + Self::Css => "css", + Self::JavaScript => "javascript", + Self::Json => "json", + Self::Python => "python", + Self::Yaml => "yaml", } ) } @@ -60,8 +60,8 @@ impl Display for ImageRendering { f, "{}", match self { - Auto => "auto", - Pixelated => "pixelated", + Self::Auto => "auto", + Self::Pixelated => "pixelated", } ) } diff --git a/src/outgoing.rs b/src/outgoing.rs index 108b565b43..72d00a1064 100644 --- a/src/outgoing.rs +++ b/src/outgoing.rs @@ -9,7 +9,7 @@ pub enum Outgoing { } impl Display for Outgoing { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { match self { Self::Amount(amount) => write!(f, "{}", amount.to_string().to_lowercase()), Self::InscriptionId(inscription_id) => inscription_id.fmt(f), diff --git a/src/wallet/transaction_builder.rs b/src/wallet/transaction_builder.rs index 9945b8f3c7..8250589535 100644 --- a/src/wallet/transaction_builder.rs +++ b/src/wallet/transaction_builder.rs @@ -62,7 +62,7 @@ pub enum Target { } impl Display for Error { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { match self { Error::Dust { output_value,