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

Add full UTF-8 support in RON incl. unicode identifiers #488

Merged
merged 33 commits into from
Sep 3, 2023

Conversation

juntyr
Copy link
Member

@juntyr juntyr commented Aug 25, 2023

Fixes #321

Superseded #444, which it rebases + adds 1aee993 to ensure that ron is always valid UTF-8

  • I've included my change in CHANGELOG.md

@codecov-commenter
Copy link

codecov-commenter commented Aug 25, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +2.01% 🎉

Comparison is base (f693d7e) 96.12% compared to head (b14096a) 98.14%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the GitHub App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #488      +/-   ##
==========================================
+ Coverage   96.12%   98.14%   +2.01%     
==========================================
  Files          77       78       +1     
  Lines        9890    10308     +418     
==========================================
+ Hits         9507    10117     +610     
+ Misses        383      191     -192     
Files Changed Coverage Δ
src/value/mod.rs 94.87% <ø> (-0.10%) ⬇️
tests/152_bitflags.rs 100.00% <ø> (+33.33%) ⬆️
tests/struct_integers.rs 100.00% <ø> (ø)
src/de/id.rs 100.00% <100.00%> (ø)
src/de/mod.rs 98.63% <100.00%> (+1.74%) ⬆️
src/de/tag.rs 100.00% <100.00%> (+17.15%) ⬆️
src/de/tests.rs 100.00% <100.00%> (ø)
src/de/value.rs 97.96% <100.00%> (+0.20%) ⬆️
src/error.rs 53.62% <100.00%> (+7.52%) ⬆️
src/extensions.rs 100.00% <100.00%> (+18.42%) ⬆️
... and 22 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@juntyr
Copy link
Member Author

juntyr commented Aug 25, 2023

@torkleyy I've finally gotten to rebasing #444. I would propose merging it after #438 lands - while I will try to find some performance improvements earlier, I think parsing in UTF8 cleans up the code so much that landing early and optimising in later commits could also be warranted.

The last commit, 93f367c, adds an API-breaking change to better encode that ron only produces valid UTF-8 during serialising (by switching from io::Write to fmt::Write). If we don't want the API breakage, we could also add our own trait that is implemented for String and anything that implements io::Write.

@juntyr juntyr marked this pull request as ready for review September 1, 2023 21:49
@juntyr
Copy link
Member Author

juntyr commented Sep 2, 2023

@ModProg @torkleyy This PR is now (almost) ready to be merged. I'll review the changes again tomorrow and add a CHANGELOG entry. Apart from that, I think this is a very good new implementation (thank you so much @ModProg for doing most of the work towards it), which can be improved performance-wise in follow-up PRs if necessary

@juntyr
Copy link
Member Author

juntyr commented Sep 2, 2023

@torkleyy We are also getting closer and closer to 100% code coverage ... maybe before releasing v0.9 that's the last thing after this PR that I take care of.

Cargo.toml Outdated Show resolved Hide resolved
Copy link
Member Author

@juntyr juntyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small cleanup is needed

src/error.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
tests/321_unicode_ident.rs Outdated Show resolved Hide resolved
src/ser/mod.rs Outdated Show resolved Hide resolved
src/ser/mod.rs Outdated Show resolved Hide resolved
src/parse.rs Outdated Show resolved Hide resolved
src/parse.rs Outdated Show resolved Hide resolved
src/parse.rs Outdated Show resolved Hide resolved
src/parse.rs Outdated Show resolved Hide resolved
src/parse.rs Outdated Show resolved Hide resolved
@juntyr juntyr merged commit 42164de into ron-rs:master Sep 3, 2023
8 checks passed
@juntyr juntyr deleted the utf8-ron branch September 3, 2023 06:53
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.

Deserializer doesn't support unicode identifiers
3 participants