Skip to content

Commit

Permalink
Update making_a_new_parser_from_scratch.md
Browse files Browse the repository at this point in the history
When trying `dbg_dmp` snippet, I noticed it does not compile. This change updates this snippet so that it matches https://docs.rs/nom/latest/nom/error/fn.dbg_dmp.html
  • Loading branch information
barower authored and Geal committed Dec 28, 2022
1 parent 3645656 commit 353f37e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/making_a_new_parser_from_scratch.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ This function wraps a parser that accepts a `&[u8]` as input and
prints its hexdump if the child parser encountered an error:

```rust
use nom::{dbg_dmp, bytes::complete::tag};
use nom::{IResult, error::dbg_dmp, bytes::complete::tag};

fn f(i: &[u8]) -> IResult<&[u8], &[u8]> {
dbg_dmp(tag("abcd"))(i)
dbg_dmp(tag("abcd"), "tag")(i)
}

let a = &b"efghijkl"[..];
Expand Down

0 comments on commit 353f37e

Please sign in to comment.