Removed a copious amount of premature Rc-s

This commit is contained in:
2023-06-18 04:22:20 +01:00
parent aebbf51228
commit 79e28883db
56 changed files with 716 additions and 636 deletions

View File

@@ -1,11 +1,12 @@
use super::any_match::any_match;
use super::shared::ScalMatcher;
use crate::ast::{Clause, Expr};
use crate::ast::Clause;
use crate::rule::matcher::RuleExpr;
use crate::rule::state::{State, StateEntry};
pub fn scal_match<'a>(
matcher: &ScalMatcher,
expr: &'a Expr,
expr: &'a RuleExpr,
) -> Option<State<'a>> {
match (matcher, &expr.value) {
(ScalMatcher::P(p1), Clause::P(p2)) if p1 == p2 => Some(State::new()),
@@ -25,7 +26,7 @@ pub fn scal_match<'a>(
pub fn scalv_match<'a>(
matchers: &[ScalMatcher],
seq: &'a [Expr],
seq: &'a [RuleExpr],
) -> Option<State<'a>> {
if seq.len() != matchers.len() {
return None;