Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Expose serde_json::de::Read to use in where clauses #250

Merged
merged 1 commit into from
Feb 11, 2017
Merged

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Feb 9, 2017

0.8.*

pub struct Client {
    reader: StreamDeserializer<serde_json::Value, Bytes<TcpStream>>,
}

fn f(c: Client) { /* ... */ }

0.9.0

pub struct Client<D> {
    reader: D,
}

fn f<D>(c: Client<D>) where D: Iterator<Item = Result<serde_json::Value, serde_json::Error>> { /* ... */ }

now

pub struct Client<R> {
    reader: StreamDeserializer<R, serde_json::Value>,
}

fn f<R>(c: Client<R>) where R: serde_json::de::Read { /* ... */ }

Fixes #234. cc @sorccu

@dtolnay dtolnay requested a review from oli-obk February 9, 2017 19:14
@dtolnay dtolnay merged commit d55dff7 into master Feb 11, 2017
@dtolnay dtolnay deleted the stream branch February 11, 2017 21:07
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant