diff --git a/crates/grit-pattern-matcher/src/pattern/resolved_pattern.rs b/crates/grit-pattern-matcher/src/pattern/resolved_pattern.rs index 17b673b3c..bee1e3476 100644 --- a/crates/grit-pattern-matcher/src/pattern/resolved_pattern.rs +++ b/crates/grit-pattern-matcher/src/pattern/resolved_pattern.rs @@ -32,7 +32,7 @@ pub trait ResolvedPattern<'a, Q: QueryContext>: Clone + Debug + PartialEq { fn from_list_parts(parts: impl Iterator) -> Self; - fn from_node_binding(node: Q::Node<'a>) -> Self { + fn from_node_binding(node: &Q::Node<'a>) -> Self { Self::from_binding(Binding::from_node(node)) } diff --git a/crates/grit-pattern-matcher/src/pattern/within.rs b/crates/grit-pattern-matcher/src/pattern/within.rs index 1e657c366..c88fff704 100644 --- a/crates/grit-pattern-matcher/src/pattern/within.rs +++ b/crates/grit-pattern-matcher/src/pattern/within.rs @@ -53,7 +53,7 @@ impl Matcher for Within { for n in node.ancestors() { let state = cur_state.clone(); if self.pattern.execute( - &ResolvedPattern::from_node_binding(n), + &ResolvedPattern::from_node_binding(&n), &mut cur_state, context, logs, @@ -65,7 +65,7 @@ impl Matcher for Within { if let Some(until) = &self.until { if until.execute( - &ResolvedPattern::from_node_binding(n), + &ResolvedPattern::from_node_binding(&n), &mut cur_state, context, logs,