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

lazy utf-8 validation #433

Merged
merged 1 commit into from
Sep 3, 2023
Merged

lazy utf-8 validation #433

merged 1 commit into from
Sep 3, 2023

Conversation

dwrensha
Copy link
Member

Makes text::Reader a wrapper around &[u8] rather than an alias for &str. Does not otherwise change code generation.

This is simpler and and more internally consistent than #429, but places more burden on downstream users, who must insert a bunch of .into() calls.

Fixes #314.

Makes text::Reader a wrapper around &[u8] and defers
utf-8 validation until `to_str()` or `to_string()` is called.

This means that users will only need to pay the utf8 validation
cost if they actually need it. This also allows users to access
(broken) non-utf8 Text data. Previously such data was inaccessible.
@dwrensha dwrensha merged commit c0a5e22 into master Sep 3, 2023
6 checks passed
@dwrensha dwrensha deleted the lazy-text-validation branch September 3, 2023 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lossy utf-8 string support
1 participant