File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ fn append_zip_entry<W: std::io::Write + std::io::Seek>(
185185
186186 let ( mut zip_entry, config) = file_builder. start ( ) . map_err ( std:: io:: Error :: other) ?;
187187
188- // Use flate2 for compression
188+ // Use flate2 for compression. Level 9 is the maximum compression level for deflate.
189189 let encoder = flate2:: write:: DeflateEncoder :: new (
190190 & mut zip_entry,
191191 match compression_level {
Original file line number Diff line number Diff line change @@ -174,11 +174,11 @@ mod from_tree {
174174 let ar = rawzip:: ZipArchive :: from_slice ( buf. as_slice ( ) ) ?;
175175 assert_eq ! (
176176 {
177- let mut n: Vec <_> = ar . entries ( ) . filter_map ( |e| {
178- e . ok ( ) . map ( |entry| {
179- String :: from_utf8_lossy ( entry . file_path ( ) . as_ref ( ) ) . to_string ( )
180- } )
181- } ) . collect ( ) ;
177+ let mut n: Vec <_> = Vec :: new ( ) ;
178+ for entry_result in ar . entries ( ) {
179+ let entry = entry_result? ;
180+ n . push ( String :: from_utf8_lossy ( entry . file_path ( ) . as_ref ( ) ) . to_string ( ) ) ;
181+ }
182182 n. sort( ) ;
183183 n
184184 } ,
You can’t perform that action at this time.
0 commit comments