From 8115443990004657f77174eaa0e30ac6d830c24b Mon Sep 17 00:00:00 2001 From: Pi Lanningham Date: Mon, 17 Feb 2025 15:42:46 -0500 Subject: [PATCH] fix: clippy --- crates/uplc/src/machine.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/crates/uplc/src/machine.rs b/crates/uplc/src/machine.rs index c976bbb0..f226c901 100644 --- a/crates/uplc/src/machine.rs +++ b/crates/uplc/src/machine.rs @@ -1,4 +1,4 @@ -use std::rc::Rc; +use std::{fmt::Display, rc::Rc}; use crate::ast::{Constant, NamedDeBruijn, Term, Type}; @@ -51,14 +51,16 @@ pub enum Trace { Label(String), } -impl Trace { - pub fn to_string(&self) -> String { +impl Display for Trace { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Trace::Log(log) => log.clone(), - Trace::Label(label) => label.clone(), + Trace::Log(log) => f.write_str(log), + Trace::Label(label) => f.write_str(label), } } +} +impl Trace { pub fn unwrap_log(self) -> Option { match self { Trace::Log(log) => Some(log),