From 43fddc6e5847684149e22a647b96d15a2c51da48 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 10 Dec 2022 22:56:03 -0500 Subject: [PATCH] Re-adding 'r allowed me to remove dependency but adding in return tokens broke the build again. --- src/parser/text_element_parser.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/parser/text_element_parser.rs b/src/parser/text_element_parser.rs index f26bbfb4..0c4bf951 100644 --- a/src/parser/text_element_parser.rs +++ b/src/parser/text_element_parser.rs @@ -43,17 +43,18 @@ use tracing::trace; type UnboundMatcher<'r, I, O, E> = dyn Fn(Context<'r>, I) -> IResult; -fn context_many_till<'r: 'x, 'x, I, O, E, F, M, T>( +fn context_many_till<'r, 'x, I, O, E, F, M, T>( context: Context<'r>, mut many_matcher: M, mut till_matcher: T, -) -> impl FnMut(I) -> IResult>, F), E> +) -> impl FnMut(I) -> IResult>, F), E> + 'r where O: Into>, I: Clone + InputLength, E: ParseError, - M: for<'a> Fn(Context<'a>, I) -> IResult, - T: for<'a> Fn(Context<'a>, I) -> IResult, + M: for<'a> Fn(Context<'a>, I) -> IResult + 'r, + T: for<'a> Fn(Context<'a>, I) -> IResult + 'r, + F: 'x, { move |mut i: I| { let mut current_context = context.clone(); @@ -134,6 +135,12 @@ pub fn paragraph<'s, 'r>( fail_matcher: ChainBehavior::AndParent(Some(¶graph_end)), })); let ret = context_many_till(¶graph_context, flat_text_element, context_paragraph_end)(i); + match ret { + Ok(_) => todo!(), + Err(e) => { + return Err(e); + } + }; // TODO: FIX THIS // ret todo!()