mirror of
https://github.com/openharmony/third_party_rust_nom.git
synced 2026-07-21 01:55:22 -04:00
Update making_a_new_parser_from_scratch.md
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
This commit is contained in:
committed by
Geoffroy Couprie
parent
b7bc7eb2c7
commit
d19d9f894e
@@ -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"[..];
|
||||
|
||||
Reference in New Issue
Block a user