-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Change json::to_xxx(&Json) functions to be json::Json::to_xxx(&self) #8679
Conversation
to_str, to_pretty_str, to_writer, and to_pretty_writer were at the top level of extra::json, this moves them into an impl for Json to match with what's been done for the rest of libextra and libstd.
While you're at it, would you mind trying to move away from Otherwise this looks good to me, thanks! |
I looked into it, but the new It looks like including something like So I guess I need input on whether I should: A) wait for more additions to Of course if I'm missing something in |
It's true that there aren't as many "nice methods", but I think that it's partially by design that way. You can get You can look at the example in the |
Eventually there will be more string support in the new I/O library. Haven't gotten to that part yet. |
So I dove into this today, got a fair bit done, then ran into #8579 and #6551. Using &-ptrs in the Encoder and Decoder forces lifetime constraints where they're used, and in extra::workcache providing those constraints causes ICEs. Those ICEs, in this case, can't be worked around without having unconstrained type errors. Current status is on this branch: https://github.com/singingboyo/rust/tree/json-to-rt-io if anyone wants to take a look, but it seems to me like rt::io support isn't going to work at the moment unless we want to be using @-ptrs. |
Oh well, thanks for investigating! |
to_str, to_pretty_str, to_writer, and to_pretty_writer were at the top level of extra::json, this moves them into an impl for Json to match with what's been done for the rest of libextra and libstd. (or at least for vec and str) Also meant changing some tests. Closes #8676.
…=Manishearth Allow safety comment above attributes Closes rust-lang#8679 changelog: Enhancement: [`undocumented_safety_block`]: Added `accept-comment-above-attributes` configuration.
to_str, to_pretty_str, to_writer, and to_pretty_writer were at the top
level of extra::json, this moves them into an impl for Json to match
with what's been done for the rest of libextra and libstd. (or at least for vec and str)
Also meant changing some tests.
Closes #8676.