From 038884232b6efbabb414cb011fa0fc4e3b4c8fd6 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sat, 13 Jun 2026 09:26:56 -0700 Subject: I did some silly things. This one doesn't build. --- src/context.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/context.rs') diff --git a/src/context.rs b/src/context.rs index 7484a1f..d322411 100644 --- a/src/context.rs +++ b/src/context.rs @@ -39,21 +39,27 @@ impl MappedStructure for Context { } pub struct StatefulContext<'a, T: MappedStructure> { - root: &'a T, - current: &'a T, + pub root: &'a T, + local: &'a T, } impl<'a, T: MappedStructure> StatefulContext<'a, T> { pub fn root( root: &'a T ) -> Self { Self { - root, current: root, + root, local: root, } } - pub fn local(&self, current: &'a T ) -> Self { + pub fn local(&self, local: &'a T ) -> Self { Self { root: self.root, - current + local + } + } + + pub fn full( root: &'a T, local: &'a T ) -> Self { + Self { + root, local } } } @@ -66,7 +72,7 @@ impl<'a, T: MappedStructure> MappedStructure for StatefulContext<'a,T> { if id[0] == IdentifierValue::Root { self.root.get_value( &id[1..] ) } else { - self.current.get_value( id ) + self.local.get_value( id ) } } } -- cgit v1.2.3