From a914360cc6589973cae22cd0c7a4215b88b1f06c Mon Sep 17 00:00:00 2001 From: Jan Ferdinand Sauer Date: Wed, 27 Sep 2023 23:49:41 +0200 Subject: [PATCH] derive `Display` for `FriValidationError` --- triton-vm/src/fri.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/triton-vm/src/fri.rs b/triton-vm/src/fri.rs index a40982d7..99973d5f 100644 --- a/triton-vm/src/fri.rs +++ b/triton-vm/src/fri.rs @@ -1,5 +1,3 @@ -use std::error::Error; -use std::fmt; use std::marker::PhantomData; use anyhow::bail; @@ -7,6 +5,7 @@ use anyhow::Result; use itertools::Itertools; use num_traits::One; use rayon::iter::*; +use strum_macros::Display; use twenty_first::shared_math::b_field_element::BFieldElement; use twenty_first::shared_math::other::log_2_ceil; use twenty_first::shared_math::polynomial::Polynomial; @@ -29,15 +28,7 @@ use crate::stark::MTMaker; pub type AuthenticationStructure = Vec; -impl Error for FriValidationError {} - -impl fmt::Display for FriValidationError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "Deserialization error for LowDegreeProof: {self:?}") - } -} - -#[derive(PartialEq, Eq, Debug)] +#[derive(PartialEq, Eq, Debug, Display)] pub enum FriValidationError { IncorrectNumberOfRevealedLeaves, BadMerkleAuthenticationPath,