rust-bakery / nom

Rust parser combinator framework
MIT License
9.18k stars 792 forks source link

Allow tag/is_not/similar to take u8 in addition to arrays and slices #1692

Open LunarLambda opened 9 months ago

LunarLambda commented 9 months ago

parsers that look for fixed data like tag, is_not, and similar (generally ones that use the FindToken trait?) should be able to take single u8s so they can be used with byte character literals or for matching precise byte values. Currently impls exist for [u8; 1] which is cumbersome, and &[u8] which means needing to use byte strings, and either dereferencing or casting them (as byte string literals are &[u8; N], for which no impls exist).