diff --git a/rust/src/util.rs b/rust/src/util.rs index 2b18bda..1323eae 100644 --- a/rust/src/util.rs +++ b/rust/src/util.rs @@ -82,7 +82,7 @@ impl Display for Sizing { } } -#[derive(Clone, PartialEq, Eq, Hash, Debug)] +#[derive(Clone, Eq, Hash, Debug)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate = "serde_crate"))] pub struct Variant { pub name: VariantName, @@ -107,6 +107,12 @@ impl Variant { } } +impl PartialEq for Variant { + fn eq(&self, other: &Self) -> bool { + self.tag == other.tag || self.name == other.name + } +} + impl PartialOrd for Variant { fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } }