From 5c39a6a7bf7dee303fabff859c2226e01475678d Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 16 Jul 2022 20:45:38 -0400 Subject: [PATCH] Lifetime issue. --- src/parser/text_element_parser.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/parser/text_element_parser.rs b/src/parser/text_element_parser.rs index 4c2f568c..7f7c79ce 100644 --- a/src/parser/text_element_parser.rs +++ b/src/parser/text_element_parser.rs @@ -41,7 +41,7 @@ pub trait ParserWithContext { fn bind_context<'a, 'c>( &mut self, context: &mut NomContext<'c, &'a str, &'a str, VerboseError<&'a str>>, - ) -> Box IResult<&'a str, &'a str, VerboseError<&'a str>>>; + ) -> Box IResult<&'a str, TextElement<'a>, VerboseError<&'a str>>>; } impl ParserWithContext for F @@ -55,10 +55,13 @@ where &mut self, context: &mut NomContext<'c, &str, &str, VerboseError<&str>>, ) -> Box< - (dyn for<'a> FnMut(&'a str) -> Result<(&'a str, &'a str), nom::Err>> + (dyn for<'a> FnMut( + &'a str, + ) + -> Result<(&'a str, TextElement<'a>), nom::Err>> + 'static), > { - Box::new(|i| self.call_mut((i, context))) + Box::new(|i| self(i, context)) } }