Skip to content
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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant