Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Improvements #125

Closed
wants to merge 7 commits into from
Closed

Improvements #125

wants to merge 7 commits into from

Conversation

zonyitoo
Copy link
Contributor

  1. Let Parser works with io::Chars
  2. Add a Reader for working with streams: Require a Stream that could parse Json from a std::io::Read #124
  3. Encoder uses io::Write instead of fmt::Write: json::Encoder should use std::io::Write instead of std::fmt::Write #111
  4. Add APIs for &[u8]

Breaking changes:

  1. Builder and Parser accepts Iterator<Item=ParserResult<char>>
  2. Json::from_reader will not check tailing characters

@rust-highfive
Copy link

r? @huonw

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Contributor

This is quite a large breaking change to this library currently, and I'm not 100% convinced that it may be worth breaking it just yet. For example io::Chars is known to not be performant, it's largely just provided for convenience (and it's unstable).

@zonyitoo
Copy link
Contributor Author

@alexcrichton You are right. But at least, rustc_serialize::json should be able to work with io::Read for network streaming. That is why I opened this PR.

I know this PR may not be the best way to support this feature, so I am asking for suggestions ...

@huonw
Copy link
Contributor

huonw commented Jul 7, 2015

r? @alexcrichton

@rust-highfive rust-highfive assigned alexcrichton and unassigned huonw Jul 7, 2015
@alexcrichton
Copy link
Contributor

@zonyitoo Unfortunately I don't personally have suggestions right now of how this can be done other than "read it all into memory", but I'd basically just recommend running benchmarks to ensure that this doesn't regress performance.

@zonyitoo
Copy link
Contributor Author

zonyitoo commented Jul 8, 2015

@alexcrichton Alright, let me make some benchmarks.

@alexcrichton
Copy link
Contributor

alexcrichton commented Apr 21, 2017

I'm going to close this now that this crate is deprecated in favor of serde. We're discontinuing feature development in rustc-serialize but will still continue to merge bug fixes if they arise.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants