From 54e988aa3d31fb21d3397758f4b71d084e1a1130 Mon Sep 17 00:00:00 2001 From: superwhiskers Date: Wed, 17 Dec 2025 21:22:37 -0600 Subject: simple union-find implementation Change-Id: I32b78b3eee68205032591578fca70c366a6a6964 --- crates/core/src/expressions/mod.rs | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'crates/core/src/expressions') diff --git a/crates/core/src/expressions/mod.rs b/crates/core/src/expressions/mod.rs index 5ffb5a6..eadd55d 100644 --- a/crates/core/src/expressions/mod.rs +++ b/crates/core/src/expressions/mod.rs @@ -1040,7 +1040,7 @@ where /// Representation of an error that occurred within [`Expression`]. #[non_exhaustive] -#[derive(PartialEq, Eq)] +#[derive(Clone, PartialEq, Eq)] #[cfg_attr(feature = "core-fmt", derive(Debug))] pub enum Error { /// Memory reservation error. @@ -1093,6 +1093,10 @@ impl error::Error for Error {} #[cfg(all(test, feature = "core-error"))] mod test { + #![allow(clippy::arithmetic_side_effects)] + #![allow(clippy::indexing_slicing)] + #![allow(clippy::unreachable)] + #![allow(clippy::wildcard_enum_match_arm)] #![allow(clippy::expect_used)] use super::*; @@ -1258,7 +1262,10 @@ mod test { type Transition = ExpressionTransition; fn init_state() -> BoxedStrategy { - //TODO: randomly initialize state + //NOTE: we could randomly initialize state. i don't think this is + // necessary to test this sufficiently, but if we ever do, we + // also need to tweak the constructor of the [`Expression`] + // to replicate one from the reference state Just(Self::State::default()).boxed() } @@ -1436,17 +1443,8 @@ mod test { type Reference = ExpressionReference; fn init_test( - ref_state: &::State, + _ref_state: &::State, ) -> Self::SystemUnderTest { - /*let mut expr = Expression { - inner: Vec::new(), - interns: Vec::new(), - root: ref_state.root.map(NodeIndexInternal), - }; - - for node in ref_state.nodes { - //TODO: finish replicating state over here - }*/ ExpressionWrapper::Closed(Expression::new()) } -- cgit 1.4.1-2-gfad0