Skip to content

Commit

Permalink
Remove unnecessary lifetime from Formatter (ordinals#3178)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Feb 27, 2024
1 parent 3e113de commit f943248
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion crates/ordinals/src/rarity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl TryFrom<u8> for Rarity {
}

impl Display for Rarity {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
write!(
f,
"{}",
Expand Down
4 changes: 2 additions & 2 deletions crates/ordinals/src/sat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion src/decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/index/reorg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
14 changes: 7 additions & 7 deletions src/inscriptions/media.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
)
}
Expand All @@ -60,8 +60,8 @@ impl Display for ImageRendering {
f,
"{}",
match self {
Auto => "auto",
Pixelated => "pixelated",
Self::Auto => "auto",
Self::Pixelated => "pixelated",
}
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/outgoing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/transaction_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f943248

Please sign in to comment.