Repository navigation
Conversation
Use peek() instead of next_char() before matching true/false so the fallback parse_str path reads the full key. Avoids invalid UTF-8 in error messages for multibyte keys and fixes empty-key edge cases. Fixes serde-rs#1364 Co-authored-by: young1lin <young1lin@users.noreply.github.com>
Author
|
Closing — withdrawing OpenJobs-related submission. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1364
OpenJobs listing: 2abe1ca8-ece3-402d-b5d0-85312697221d
Via openjobs.bot
https://openjobs.bot/jobs/2abe1ca8-ece3-402d-b5d0-85312697221d
Summary
In
MapKey::deserialize_bool, usepeek()and onlyeat_char()on thet/fbranches so the invalid-key fallback runsparse_strfrom the start of the key (same pattern as numeric map keys). Avoids constructing invalid UTF-8 from continuation bytes.Test plan
Added
test_boolean_key_invalidcovering multibyte invalid key{"éx": 1}, ASCII invalid{"yes": 1}, empty key;from_str/from_slice/from_reader.Commit: a7045d3