-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
serialize::json can't handle HashMap<uint, V> #12967
Comments
olsonjeffery
added a commit
to olsonjeffery/rust
that referenced
this issue
Mar 17, 2014
… numeric type serialize: ref rust-lang#12697 minor adj. to last char check + prettyencode test
bors
added a commit
that referenced
this issue
Mar 19, 2014
Closes #13008 (Made the `clone_from` implementation for `~T` reuse the `T` itself if possible) Closes #13003 (Make method Vec::remove() public) Closes #13002 (disallow duplicate methods in trait impls) Closes #13000 (rustc: test: don't silently ignore bad benches) Closes #12999 (rustc: buffer the output writer for -Z ast-json[-noexpand].) Closes #12993 (syntax: Don't parameterize the the pretty printer) Closes #12990 (`char` reference: s/character/Unicode scalar value/) Closes #12987 (Move syntax-extension-hexfloat.rs) Closes #12983 (Fix linkage1 test which fails due to --as-needed) Closes #12978 (rustc: remove linker_private/linker_private_weak) Closes #12976 (libsyntax: librustdoc: ignore utf-8 BOM in .rs files) Closes #12973 (closes #12967 fix [en|de]coding of HashMap<K,V> where K is a numeric type) Closes #12972 (Add impl IntoStr for ::std::vec_ng::Vec<Ascii>) Closes #12968 (deny missing docs getopts) Closes #12965 (Documentation and formatting changes for option.rs.) Closes #12962 (Relax the memory ordering on the implementation of UnsafeArc) Closes #12958 (Typo fixes.) Closes #12950 (Docsprint: Document ops module, primarily Deref.) Closes #12946 (rustdoc: Implement cross-crate searching)
lnicola
pushed a commit
to lnicola/rust
that referenced
this issue
Aug 16, 2022
[code] make toggleInlayHints understand {off,on}UntilPressed fixes rust-lang#12964
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
or, AFAIK, any other numeric value.. I've isolated a few test cases in my local branch:
here be the spew:
In case it isn't obvious:
{1:true}
is not valid JSON. Not only does it not pass muster for the web-based validators I checked (plus firefox's JSONView addon), but evenserialize::json
will not decode a JSON string created by it's own encoder.The other test was something I created to catch/anticipate what the solution would end up producing.
I dug into the code for
json::Encoder
a bit and one of the solutions I wanted to pursue was to, inemit_map_elt_key
, look at the state of the output bytes after running thef
param that actually maps the key value. You can then see if the last key added is wrapped in quotes and add them if they're missing.Sadly, the output state is kept as a
&mut Writer
so you have no ability examine/mutate it.. So I guessDecoder
/Encoder
will have to keep their own~[u8]
that it will grow/mutate during the process, and then dump into thewr
field at the end, instead of growing it organically during the parsing process.The text was updated successfully, but these errors were encountered: