mirror of
https://gitee.com/openharmony/third_party_rust_nom
synced 2024-11-23 07:29:54 +00:00
relax the flat_map argument from Fn to FnMut
This commit is contained in:
parent
f8633f9a8f
commit
324125f23e
@ -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| {
|
||||
|
@ -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,
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user