From e0b750a57d76e4100c44d83592c6dd892d21292b Mon Sep 17 00:00:00 2001 From: dewert99 Date: Fri, 20 Dec 2024 19:02:43 -0800 Subject: [PATCH] Fix serde --- src/raw/egraph.rs | 4 ++++ src/raw/unionfind.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/raw/egraph.rs b/src/raw/egraph.rs index e3449d1a..b1c58c06 100644 --- a/src/raw/egraph.rs +++ b/src/raw/egraph.rs @@ -36,6 +36,10 @@ impl<'a> IntoIterator for Parents<'a> { /// See [`RawEGraph::classes_mut`], [`RawEGraph::get_class_mut`] #[derive(Clone)] #[cfg_attr(feature = "serde-1", derive(Serialize, Deserialize))] +#[cfg_attr( + feature = "serde-1", + serde(bound(serialize = "L: Serialize", deserialize = "L: Deserialize<'de>")) +)] pub struct EGraphResidual> { pub(super) unionfind: UnionFind

, /// Stores the original node represented by each non-canonical id diff --git a/src/raw/unionfind.rs b/src/raw/unionfind.rs index 9bf8d6a6..8dd45d9b 100644 --- a/src/raw/unionfind.rs +++ b/src/raw/unionfind.rs @@ -51,9 +51,11 @@ impl Debug for RawUnionFindElt { #[derive(Debug, Clone, Default)] #[cfg_attr(feature = "serde-1", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr(feature = "serde-1", serde(bound = ""))] /// Data structure that stores disjoint sets of `Id`s each with a representative pub struct UnionFind> { pub(super) parents: Vec, + #[cfg_attr(feature = "serde-1", serde(skip))] phantom: PhantomData

, }