Skip to content

Commit

Permalink
Fix serde
Browse files Browse the repository at this point in the history
  • Loading branch information
dewert99 committed Dec 21, 2024
1 parent fb3861d commit e0b750a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/raw/egraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<L: Language, P: PathCompressT = PathCompress<true>> {
pub(super) unionfind: UnionFind<P>,
/// Stores the original node represented by each non-canonical id
Expand Down
2 changes: 2 additions & 0 deletions src/raw/unionfind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<P: PathCompressT = PathCompress<true>> {
pub(super) parents: Vec<RawUnionFindElt>,
#[cfg_attr(feature = "serde-1", serde(skip))]
phantom: PhantomData<P>,
}

Expand Down

0 comments on commit e0b750a

Please sign in to comment.