Repository navigation
docs: note that integer/bool/float map keys are stringified - #1344
Open
SatvikMishra08 wants to merge 1 commit into
Open
SatvikMishra08 wants to merge 1 commit into
SatvikMishra08 wants to merge 1 commit into
Conversation
The Errors sections for to_value and related serializers still said map serialization fails on any non-string key. Since serde-rs#231 (and later bool/float support), those key types are converted to strings; only keys that cannot be stringified fail. Fixes serde-rs#1058
Author
|
Small docs note on stringified map keys — still ready whenever you have a moment. Happy to reword. |
This branch has not been deployed
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.
Summary
Updates the Errors rustdoc for
to_valueand related serializers so they no longer claim that any non-string map key causes failure. Integer, boolean, and floating-point keys are converted to strings (since #231 and follow-ups); only keys that cannot be stringified fail.Fixes #1058
Changes
Grep'd
non-string keysand updated all matches in:src/value/mod.rs(to_value)src/ser.rs(to_writer,to_writer_pretty,to_vec,to_vec_pretty,to_string,to_string_pretty)src/raw.rssrc/macros.rs(json!)The existing doctest example with
Veckeys (still an error) is unchanged.Test plan