Skip to content

Commit ab01f04

Browse files
jufajardiniGeal
authored andcommitted
Update json.rs
Hey, I'm trying to get a better understanding of `nom` reading this example, and think the following makes sense: - delete lines `70` and `71`, as `value` was already described (lines `64 to 66`), and this other description seemed incomplete - change `true` to `false` in line `75`, as it makes more sense with the code that follows
1 parent b657387 commit ab01f04

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

examples/json.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,12 @@ fn parse_str<'a, E: ParseError<&'a str>>(i: &'a str) -> IResult<&'a str, &'a str
6767
///
6868
/// `alt` is another combinator that tries multiple parsers one by one, until
6969
/// one of them succeeds
70-
///
71-
/// `value` is a combinator that returns its value if the inner parser
7270
fn boolean<'a, E: ParseError<&'a str>>(input: &'a str) -> IResult<&'a str, bool, E> {
7371
// This is a parser that returns `true` if it sees the string "true", and
7472
// an error otherwise
7573
let parse_true = value(true, tag("true"));
7674

77-
// This is a parser that returns `true` if it sees the string "true", and
75+
// This is a parser that returns `false` if it sees the string "false", and
7876
// an error otherwise
7977
let parse_false = value(false, tag("false"));
8078

0 commit comments

Comments
 (0)