Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upEncode/decode to/from references to readers #2
Conversation
|
Looks good! Thanks for the pull request! Before I merge, why is R forced to implement Buffer? I'd like to keep the constraints as low as possible, but if you have a good reason, I'll merge this. Also, do you want to be added as a contributor? |
| } | ||
|
|
||
| impl <R: Reader> DecoderReader<R> { | ||
| pub fn new(r: R) -> DecoderReader<R> { | ||
| impl<'a, R: Reader+Buffer> DecoderReader<'a, R> { |
This comment has been minimized.
This comment has been minimized.
|
Before, the code got around that by using a No need to add me as a contributor, I'll just do the pull request thang 'cause it's fun. Thanks for writing this btw! They should put something like this in the standard library, especially since they even included json. This library is going to clean up a ton of binary serialization code in my project. |
|
Ok, yeah, that makes sense! Thanks for your contribution! I'll merge this On Thursday, October 9, 2014, Theodore DeRego notifications@github.com
-Ty Overby |
Encode/decode to/from references to readers
tedsta commentedOct 9, 2014
I borrowed the pattern used in the json encoder in the standard library. The code uses an unsafe block, but I guess it can be removed whenever rust-lang/rust#14302 is resolved. All the tests pass at least :P