diff --git a/src/combinator/mod.rs b/src/combinator/mod.rs index 2ba84d1..7071cc7 100644 --- a/src/combinator/mod.rs +++ b/src/combinator/mod.rs @@ -205,11 +205,11 @@ where /// ``` pub fn flat_map, F, G, H>( mut parser: F, - applied_parser: G, + mut applied_parser: G, ) -> impl FnMut(I) -> IResult where F: Parser, - G: Fn(O1) -> H, + G: FnMut(O1) -> H, H: Parser, { move |input: I| { diff --git a/src/internal.rs b/src/internal.rs index 762f3d8..8a3c6a1 100644 --- a/src/internal.rs +++ b/src/internal.rs @@ -259,7 +259,7 @@ pub trait Parser { /// Creates a second parser from the output of the first one, then apply over the rest of the input fn flat_map(self, g: G) -> FlatMap where - G: Fn(O) -> H, + G: FnMut(O) -> H, H: Parser, Self: core::marker::Sized, {