winnow-rs / winnow

Making parsing a breeze
https://docs.rs/winnow
Other
572 stars 44 forks source link

Byte comparisons for `&str` streams can panic or worse #460

Closed epage closed 9 months ago

epage commented 9 months ago

We support byte string tags and byte tokens with &str to allow parsers that are generic over both bytes and strings. The problem is this can lead to bugs.

epage commented 9 months ago

If we had ascii::Char, we could replace bytes with that.

We could do a polyfill that tries to be a subset of ascii::Chars API to reduce the chance of a breaking change when we switch to the feature (if it gets stabilized).

459 stars to experiment with this.