fix: clippy

This commit is contained in:
Pi Lanningham 2025-02-17 15:42:46 -05:00 committed by Lucas
parent ec6f1f84e2
commit 8115443990
1 changed files with 7 additions and 5 deletions

View File

@ -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<String> {
match self {
Trace::Log(log) => Some(log),