Lifetime issue.
This commit is contained in:
parent
c67de70363
commit
5c39a6a7bf
@ -41,7 +41,7 @@ pub trait ParserWithContext {
|
|||||||
fn bind_context<'a, 'c>(
|
fn bind_context<'a, 'c>(
|
||||||
&mut self,
|
&mut self,
|
||||||
context: &mut NomContext<'c, &'a str, &'a str, VerboseError<&'a str>>,
|
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
|
impl<F> ParserWithContext for F
|
||||||
@ -55,10 +55,13 @@ where
|
|||||||
&mut self,
|
&mut self,
|
||||||
context: &mut NomContext<'c, &str, &str, VerboseError<&str>>,
|
context: &mut NomContext<'c, &str, &str, VerboseError<&str>>,
|
||||||
) -> Box<
|
) -> 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),
|
+ 'static),
|
||||||
> {
|
> {
|
||||||
Box::new(|i| self.call_mut((i, context)))
|
Box::new(|i| self(i, context))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user