From 7fe24995b2d5311826c4ecd2cf6e74b60d405add Mon Sep 17 00:00:00 2001 From: Thorkil Vaerge Date: Fri, 23 Feb 2024 14:50:25 +0100 Subject: [PATCH] Remove unneeded `Debug` trait requirement from `BasicSnippet` --- tasm-lib/src/list/higher_order/all.rs | 1 - tasm-lib/src/list/higher_order/filter.rs | 1 - tasm-lib/src/list/higher_order/inner_function.rs | 1 - tasm-lib/src/list/higher_order/map.rs | 1 - tasm-lib/src/traits/basic_snippet.rs | 3 +-- tasm-lib/src/traits/deprecated_snippet.rs | 3 +-- 6 files changed, 2 insertions(+), 8 deletions(-) diff --git a/tasm-lib/src/list/higher_order/all.rs b/tasm-lib/src/list/higher_order/all.rs index 641f30f9..41a88851 100644 --- a/tasm-lib/src/list/higher_order/all.rs +++ b/tasm-lib/src/list/higher_order/all.rs @@ -32,7 +32,6 @@ use super::inner_function::InnerFunction; /// Runs a predicate over all elements of a list and returns true only if all elements satisfy the /// predicate. -#[derive(Debug)] pub struct All { pub f: InnerFunction, } diff --git a/tasm-lib/src/list/higher_order/filter.rs b/tasm-lib/src/list/higher_order/filter.rs index 88480a1d..65ade34a 100644 --- a/tasm-lib/src/list/higher_order/filter.rs +++ b/tasm-lib/src/list/higher_order/filter.rs @@ -28,7 +28,6 @@ use super::inner_function::InnerFunction; /// Filters a given list for elements that satisfy a predicate. A new /// list is created, containing only those elements that satisfy the /// predicate. The predicate must be given as an InnerFunction. -#[derive(Debug)] pub struct Filter { pub f: InnerFunction, } diff --git a/tasm-lib/src/list/higher_order/inner_function.rs b/tasm-lib/src/list/higher_order/inner_function.rs index 2caa33df..01a94092 100644 --- a/tasm-lib/src/list/higher_order/inner_function.rs +++ b/tasm-lib/src/list/higher_order/inner_function.rs @@ -80,7 +80,6 @@ impl RawCode { } } -#[derive(Debug)] pub enum InnerFunction { RawCode(RawCode), DeprecatedSnippet(Box), diff --git a/tasm-lib/src/list/higher_order/map.rs b/tasm-lib/src/list/higher_order/map.rs index 6f5c070e..16c45e4e 100644 --- a/tasm-lib/src/list/higher_order/map.rs +++ b/tasm-lib/src/list/higher_order/map.rs @@ -34,7 +34,6 @@ currently only works with *one* input element. Use a tuple data type to circumve /// Applies a given function to every element of a list, and collects the new elements /// into a new list. -#[derive(Debug)] pub struct Map { pub f: InnerFunction, } diff --git a/tasm-lib/src/traits/basic_snippet.rs b/tasm-lib/src/traits/basic_snippet.rs index 2b61fc07..903c79d2 100644 --- a/tasm-lib/src/traits/basic_snippet.rs +++ b/tasm-lib/src/traits/basic_snippet.rs @@ -1,5 +1,4 @@ use num_traits::Zero; -use std::fmt::Debug; use triton_vm::op_stack::NUM_OP_STACK_REGISTERS; use triton_vm::prelude::*; @@ -7,7 +6,7 @@ use crate::data_type::DataType; use crate::library::Library; use crate::VmHasher; -pub trait BasicSnippet: Debug { +pub trait BasicSnippet { fn inputs(&self) -> Vec<(DataType, String)>; fn outputs(&self) -> Vec<(DataType, String)>; fn entrypoint(&self) -> String; diff --git a/tasm-lib/src/traits/deprecated_snippet.rs b/tasm-lib/src/traits/deprecated_snippet.rs index cb4469cc..88d98a56 100644 --- a/tasm-lib/src/traits/deprecated_snippet.rs +++ b/tasm-lib/src/traits/deprecated_snippet.rs @@ -1,6 +1,5 @@ use std::cell::RefCell; use std::collections::HashMap; -use std::fmt::Debug; use std::rc::Rc; use anyhow::Result; @@ -24,7 +23,7 @@ use crate::DIGEST_LENGTH; use super::basic_snippet::BasicSnippet; use super::rust_shadow::RustShadow; -pub trait DeprecatedSnippet: Debug { +pub trait DeprecatedSnippet { /// The name of a Snippet /// /// This is used as a unique identifier, e.g. when generating labels.