From eb5c4414d0ccbe5210921774aab7fab7ffc647e5 Mon Sep 17 00:00:00 2001 From: Harry Solovay Date: Tue, 1 Oct 2024 14:51:32 -0400 Subject: [PATCH] fix clippy lint --- src/api/types.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/api/types.rs b/src/api/types.rs index e61ce29..000c15d 100644 --- a/src/api/types.rs +++ b/src/api/types.rs @@ -1,3 +1,5 @@ +use std::fmt::Display; + use serde::Serialize; use sqlx::Type; @@ -23,12 +25,11 @@ pub enum TransactionStatus { Failed, } -impl ToString for TransactionStatus { - fn to_string(&self) -> String { +impl Display for TransactionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Self::Applied => "Applied", - Self::Failed => "Failed", + Self::Applied => write!(f, "Applied"), + Self::Failed => write!(f, "Failed"), } - .to_string() } }