diff --git a/src/parser/nom_context.rs b/src/parser/nom_context.rs index 67e55a48..40486f37 100644 --- a/src/parser/nom_context.rs +++ b/src/parser/nom_context.rs @@ -11,7 +11,7 @@ pub struct TestContext { head: ContextReference, } -type ContextReference = Option>>; +type ContextReference = Option>>; struct ContextLayer { data: T, @@ -32,11 +32,11 @@ impl TestContext { new_matcher: MatcherRef, ) -> TestContext { TestContext { - head: Some(Box::new(ContextLayer { + head: Some(Rc::new(ContextLayer { data: ContextData { fail_matcher: ChainBehavior::AndParent(Some(new_matcher)), }, - parent: self.head, // TODO FIX THIS + parent: self.head.clone(), })), } }