-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
DeserializeOwned
for from_reader
Based on #45 I saw that `from_reader` uses the wrong trait bounds for `T`. It does not support arbitrary types, but only those, which do not borrow from the input value. This can be expressed with `DeserializeOwned`. The `Read` trait always returns owned data and has no concept of borrowing from the input. Therefore, any type deserialize with the function also cannot borrow from the input. You see the same trait bound on `serde_json::from_reader`. The changes in `tests/` are simply to get the tests compiling afterwards.
- Loading branch information
Showing
3 changed files
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters