Skip to content

Commit

Permalink
relax the flat_map argument from Fn to FnMut
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal committed Nov 3, 2021
1 parent f8633f9 commit 324125f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/combinator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand Down
2 changes: 1 addition & 1 deletion src/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
{
Expand Down

0 comments on commit 324125f

Please sign in to comment.