History

change!: remove `zlib::stream::inflate::ReadBoxed`.

It was a special-case type that was only used in one spot, and thus not really that interesting to have in a shared place.

Sebastian Thiel committed 3 years ago

Commit 032cea31 parent 9fbed4b1 file · +0 −17Browse files

Unified · Split

gix-features/src/zlib/stream/inflate.rs+0−17
@@ -2,23 +2,6 @@ use std::{io, io::BufRead}; · 1 unmodified line
22
33 use flate2::{Decompress, FlushDecompress, Status};
44
5−/// The boxed variant is faster for what we do (moving the decompressor in and out a lot)
6−pub struct ReadBoxed<R> {
7− /// The reader from which bytes should be decompressed.
8− pub inner: R,
9− /// The decompressor doing all the work.
10− pub decompressor: Box<Decompress>,
11−}
12−
13−impl<R> io::Read for ReadBoxed<R>
14−where
15− R: BufRead,
16−{
17− fn read(&mut self, into: &mut [u8]) -> io::Result<usize> {
18− read(&mut self.inner, &mut self.decompressor, into)
19− }
20−}
21−
225 /// Read bytes from `rd` and decompress them using `state` into a pre-allocated fitting buffer `dst`, returning the amount of bytes written.
236 pub fn read(rd: &mut impl BufRead, state: &mut Decompress, mut dst: &mut [u8]) -> io::Result<usize> {
247 let mut total_written = 0;