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 upImplement distinct Flush types for Compress::compress vs Decompress::decompress #109
Conversation
chrisvittal
added some commits
May 6, 2017
alexcrichton
reviewed
May 8, 2017
|
Looks great to me! Just one minro comment about a little more flexibility around the enum, but otherwise I'd be ready to merge for the 1.0 release. |
| /// The return value may indicate that the stream is not yet done and more | ||
| /// data has yet to be processed. | ||
| Finish = ffi::MZ_FINISH as isize | ||
| } |
This comment has been minimized.
This comment has been minimized.
alexcrichton
May 8, 2017
Owner
While we're at it, both of these flush enums are intended to be extensible in the sense that client code shouldn't match on them exhaustively. To accomplish this mind adding a __Nonexhaustive variant tagged with #[doc(hidden)] to both enums? That way it should hopefully send a signal of "we may extend this in the future".
This comment has been minimized.
This comment has been minimized.
|
|
fstirlitz
reviewed
Jun 24, 2017
| /// This is for advanced applications that need to control the emission of | ||
| /// deflate blocks. | ||
| Block = ffi::MZ_BLOCK as isize, | ||
|
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
alexcrichton
Jul 3, 2017
Owner
@fstirlitz I believe it's because it's not actually used in the backend, but do you have a use case for it?
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton seems it's the last one already. Merge it and the crate is ready for evaluation! |
chrisvittal
added some commits
Sep 8, 2017
This comment has been minimized.
This comment has been minimized.
|
Indeed yeah thanks! I just need to allocate some time to go through the final steps of releasing 1.0 and then publish 1.0. I'll be sure to merge this before that though! |
alexcrichton
merged commit d9291ed
into
alexcrichton:master
Nov 7, 2017
This comment has been minimized.
This comment has been minimized.
|
Alright I'm doing some prep work so I've merged, thanks so much again @chrisvittal for taking this on! |
chrisvittal commentedMay 7, 2017
•
edited
This implements distinct flush types (
FlushCompressandFlushDecompress) forCompress::compressandDecompress::decompressas in #79. It also removes the oldFlushtype.To keep the code generic in
read<R: BufRead, D: Ops>andWriter<W: Write, D: Ops>, this adds an internalFlushtrait for abstracting over the common values of the new flush types. This newFlushtrait is used as a bound for a new associated type (also calledFlush) forOps.