Lifetime issue.

feature_matrix
Tom Alexander 2 years ago
parent c67de70363
commit 5c39a6a7bf
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

@ -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<dyn FnMut(&'a str) -> IResult<&'a str, &'a str, VerboseError<&'a str>>>;
) -> Box<dyn FnMut(&'a str) -> IResult<&'a str, TextElement<'a>, VerboseError<&'a str>>>;
}
impl<F> 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<VerboseError<&'a str>>>
(dyn for<'a> FnMut(
&'a str,
)
-> Result<(&'a str, TextElement<'a>), nom::Err<VerboseError<&'a str>>>
+ 'static),
> {
Box::new(|i| self.call_mut((i, context)))
Box::new(|i| self(i, context))
}
}

Loading…
Cancel
Save