From 11cf24a50070633004690f8ecddd10feea23e3f3 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 3 Dec 2022 22:49:56 -0500 Subject: [PATCH] Trying to switch to unbound matchers. --- src/parser/text_element_parser.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/parser/text_element_parser.rs b/src/parser/text_element_parser.rs index 2f4ac07f..ffb37b5a 100644 --- a/src/parser/text_element_parser.rs +++ b/src/parser/text_element_parser.rs @@ -39,18 +39,15 @@ use nom::Parser; use tracing::instrument; use tracing::trace; -type UnboundMatcher<'r> = - dyn for<'s> Fn(Context<'r>, &'s str) -> IResult<&'s str, &'s str, VerboseError<&'s str>>; +type UnboundMatcher<'r, I, O, E> = dyn for<'s> Fn(Context<'r>, I) -> IResult; -fn context_many_till<'r, I, O, E, F, M, T>( +fn context_many_till<'r, I, O, E, F>( context: Context<'r>, - mut many_matcher: M, - mut till_matcher: T, + mut many_matcher: UnboundMatcher<'r, I, O, E>, + mut till_matcher: UnboundMatcher<'r, I, F, E>, ) -> impl FnMut(I) -> IResult, F), E> where I: Clone + InputLength, - M: Parser, - T: Parser, E: ParseError, { move |mut i: I| {