This PR makes that change and also removes a pointless import of nom::combinator::value.
The example in question was the only documentation I could find on how to write a combinator of your own (but to be honest I haven't looked very hard), so that's why I think it's important to get it right.
The custom combinator from the "Wrapper combinators that eat whitespace before and after a parser" example uses the needlessly specific trait bound
FnMut(...) -> IResult
for its parser parameter type, which limits its applicability as a combinator, because not all parsers (e.g.Map
) implement theFnMut(...) -> IResult
trait. But conversely,FnMut(...) -> IResult
implements theParser
trait, so IMHO usingParser
as the trait bound instead would make perfect sense.This PR makes that change and also removes a pointless import of
nom::combinator::value
.The example in question was the only documentation I could find on how to write a combinator of your own (but to be honest I haven't looked very hard), so that's why I think it's important to get it right.