Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
epage opened this issue Feb 7, 2024 · 1 comment · Fixed by #471
Closed

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

epage opened this issue Feb 7, 2024 · 1 comment · Fixed by #471
Labels
A-input Area: input / parsing state C-bug Category: Things not working as expected M-breaking-change Meta: Implementing or merging this will introduce a breaking change.
Milestone

Comments

@epage
Copy link
Collaborator

epage commented Feb 7, 2024

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 epage added M-breaking-change Meta: Implementing or merging this will introduce a breaking change. C-bug Category: Things not working as expected A-input Area: input / parsing state labels Feb 7, 2024
@epage
Copy link
Collaborator Author

epage commented Feb 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-input Area: input / parsing state C-bug Category: Things not working as expected M-breaking-change Meta: Implementing or merging this will introduce a breaking change.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant