From 889f82e4e64452f26c53c6ff6ec88198786e2560 Mon Sep 17 00:00:00 2001 From: Mathieu Poumeyrol Date: Tue, 5 Sep 2023 13:09:01 +0200 Subject: [PATCH] fix Eq on TValue --- core/src/value.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/src/value.rs b/core/src/value.rs index 3a492a3005..275847f765 100644 --- a/core/src/value.rs +++ b/core/src/value.rs @@ -1,10 +1,11 @@ use crate::internal::*; +use std::ops::Deref; use std::rc::Rc; use tract_ndarray::Array; use TValue::*; -#[derive(Clone, PartialEq, Eq)] +#[derive(Clone, Eq)] pub enum TValue { Const(Arc), Var(Rc), @@ -16,6 +17,12 @@ impl std::fmt::Debug for TValue { } } +impl PartialEq for TValue { + fn eq(&self, other: &Self) -> bool { + self.deref() == other.deref() + } +} + impl TValue { pub fn is_exclusive(&self) -> bool { match self {