diff --git a/src/parser/new_context.rs b/src/parser/new_context.rs index 4e5dc2e7..5c38ecaa 100644 --- a/src/parser/new_context.rs +++ b/src/parser/new_context.rs @@ -6,7 +6,7 @@ use super::text::bold_end; use super::text::Res; type Matcher = dyn for<'s> Fn(&'s str) -> IResult<&'s str, &'s str, VerboseError<&'s str>>; -type Link<'r> = Option<&'r Node<'r>>; +type Link<'r, T> = Option<&'r Node<'r, T>>; pub trait OrgModeContext<'r> { // todo @@ -25,14 +25,14 @@ pub enum ChainBehavior<'r> { IgnoreParent(Option<&'r Matcher>), } -struct Node<'r> { - elem: &'r dyn OrgModeContext<'r>, - parent: Link<'r>, +struct Node<'r, T: 'r + ?Sized> { + elem: &'r T, + parent: Link<'r, T>, } struct ContextTree<'r> { // Not using Link so the ContextTree can own this node - head: Option>, + head: Option>>, } impl<'r> ContextTree<'r> {