relax the flat_map argument from Fn to FnMut

This commit is contained in:
Geoffroy Couprie 2021-11-03 23:03:33 +01:00
parent f8633f9a8f
commit 324125f23e
2 changed files with 3 additions and 3 deletions

View File

@ -205,11 +205,11 @@ where
/// ```
pub fn flat_map<I, O1, O2, E: ParseError<I>, F, G, H>(
mut parser: F,
applied_parser: G,
mut applied_parser: G,
) -> impl FnMut(I) -> IResult<I, O2, E>
where
F: Parser<I, O1, E>,
G: Fn(O1) -> H,
G: FnMut(O1) -> H,
H: Parser<I, O2, E>,
{
move |input: I| {

View File

@ -259,7 +259,7 @@ pub trait Parser<I, O, E> {
/// Creates a second parser from the output of the first one, then apply over the rest of the input
fn flat_map<G, H, O2>(self, g: G) -> FlatMap<Self, G, O>
where
G: Fn(O) -> H,
G: FnMut(O) -> H,
H: Parser<I, O2, E>,
Self: core::marker::Sized,
{