Join GitHub today
GitHub is home to over 40 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
This comment has been minimized.
This comment has been minimized.
|
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? |
TyOverby
reviewed
Oct 10, 2014
| } | ||
|
|
||
| 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.
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. |
This comment has been minimized.
This comment has been minimized.
|
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 |
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