Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdded compression examples #111
Conversation
This comment has been minimized.
This comment has been minimized.
|
Awesome thanks so much for doing this! I'll take a look now |
alexcrichton
reviewed
May 10, 2017
|
Ok other than a few minor things looks great! Could you also throw a comment at the top of each example with just a small word or two as to what it's doing at a high level? |
| println!("{}", decode_bufreader(bytes).unwrap()); | ||
| } | ||
|
|
||
| fn decode_bufreader(bytes: Vec<u8>) -> Result<String, std::io::Error> { |
This comment has been minimized.
This comment has been minimized.
alexcrichton
May 10, 2017
Owner
The return type here may be a bit more readable as io::Result<String> perhaps? That tends to be how Result<T, io::Error> is referenced idiomatically
| } | ||
|
|
||
| fn decode_bufreader(bytes: Vec<u8>) -> Result<String, std::io::Error> { | ||
| let cursor = Cursor::new(bytes); |
This comment has been minimized.
This comment has been minimized.
alexcrichton
May 10, 2017
Owner
I think you can actually elide the Cursor here via impl Read for &[u8], it'll just involve transforming bytes: Vec<u8> to bytes: &[u8] and then passing that into the decoder.
AndyGauge
force-pushed the
AndyGauge:examples
branch
from
b27d032
to
4f949ba
May 11, 2017
This comment has been minimized.
This comment has been minimized.
|
I rebased this, I didn't like the number of commits in the PR. |
This comment has been minimized.
This comment has been minimized.
|
No worries! Is this ready to go? It's looking absolutely fantastic! |
This comment has been minimized.
This comment has been minimized.
|
I'm at a stopping point. I'll work on Deflate next. Feel free to merge this and I'll open up another PR for Deflate. |
This comment has been minimized.
This comment has been minimized.
|
Sounds great to me, thanks so much again @AndyGauge! |
AndyGauge commentedMay 9, 2017
•
edited
For #76
NOT FINISHED
Before completing the decompression examples, and possibly adding other methods to the examples, I was hoping for a code review to confirm these are desired.