diff --git a/doc/nom_recipes.md b/doc/nom_recipes.md index e80378d5..f35dfc07 100644 --- a/doc/nom_recipes.md +++ b/doc/nom_recipes.md @@ -35,15 +35,13 @@ use nom::{ /// A combinator that takes a parser `inner` and produces a parser that also consumes both leading and /// trailing whitespace, returning the output of `inner`. -fn ws<'a, F, O, E: ParseError<&'a str>>(inner: F) -> impl Parser<&'a str> - where - F: Parser<&'a str>, +pub fn ws<'a, O, E: ParseError<&'a str>, F>( + inner: F, +) -> impl FnMut(&'a str) -> IResult<&'a str, O, E> +where + F: Parser<&'a str, O, E>, { - delimited( - multispace0, - inner, - multispace0 - ) + delimited(multispace0, inner, multispace0) } ```