31
31
use crate :: {
32
32
ErrorContext , FileTypeIO , FileTypeRead , FileTypeWrite , LazyAgents , LazyRead , LazyWrite ,
33
33
} ;
34
- use flate2:: read:: GzDecoder ;
34
+ use flate2:: read:: MultiGzDecoder ;
35
35
use flate2:: write:: GzEncoder ;
36
36
use flate2:: Compression ;
37
37
use martian:: { Error , MartianFileType } ;
50
50
F : MartianFileType + FileTypeIO < T > ,
51
51
{
52
52
fn read ( & self ) -> Result < T , Error > {
53
- let decoder = GzDecoder :: new ( self . buf_reader ( ) ?) ;
53
+ let decoder = MultiGzDecoder :: new ( self . buf_reader ( ) ?) ;
54
54
<Self as FileTypeRead < T > >:: read_from ( decoder) . map_err ( |e| {
55
55
let context = ErrorContext :: ReadContext ( self . as_ref ( ) . into ( ) , e. to_string ( ) ) ;
56
56
e. context ( context)
@@ -143,7 +143,7 @@ where
143
143
/// stores a list of items.
144
144
pub struct LazyGzipReader < L , T , R >
145
145
where
146
- L : LazyRead < T , GzDecoder < R > > ,
146
+ L : LazyRead < T , MultiGzDecoder < R > > ,
147
147
R : Read ,
148
148
{
149
149
inner : L ,
@@ -152,21 +152,21 @@ where
152
152
153
153
impl < L , T , R > LazyRead < T , R > for LazyGzipReader < L , T , R >
154
154
where
155
- L : LazyRead < T , GzDecoder < R > > ,
155
+ L : LazyRead < T , MultiGzDecoder < R > > ,
156
156
R : Read ,
157
157
{
158
158
type FileType = Gzip < L :: FileType > ;
159
159
fn with_reader ( reader : R ) -> Result < Self , Error > {
160
160
Ok ( LazyGzipReader {
161
- inner : L :: with_reader ( GzDecoder :: new ( reader) ) ?,
161
+ inner : L :: with_reader ( MultiGzDecoder :: new ( reader) ) ?,
162
162
phantom : PhantomData ,
163
163
} )
164
164
}
165
165
}
166
166
167
167
impl < L , T , R > Iterator for LazyGzipReader < L , T , R >
168
168
where
169
- L : LazyRead < T , GzDecoder < R > > ,
169
+ L : LazyRead < T , MultiGzDecoder < R > > ,
170
170
R : Read ,
171
171
{
172
172
type Item = Result < T , Error > ;
@@ -179,7 +179,7 @@ impl<F, T, W, R> LazyAgents<T, W, R> for Gzip<F>
179
179
where
180
180
R : Read ,
181
181
W : Write ,
182
- F : LazyAgents < T , GzEncoder < W > , GzDecoder < R > > ,
182
+ F : LazyAgents < T , GzEncoder < W > , MultiGzDecoder < R > > ,
183
183
{
184
184
type LazyWriter = LazyGzipWriter < F :: LazyWriter , T , W > ;
185
185
type LazyReader = LazyGzipReader < F :: LazyReader , T , R > ;
0 commit comments