File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
decompression-plz/src/decompression Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,12 @@ impl MultiDecompressError {
1515 }
1616}
1717
18+ impl From < std:: io:: Error > for MultiDecompressError {
19+ fn from ( e : std:: io:: Error ) -> Self {
20+ MultiDecompressError :: new ( MultiDecompressErrorReason :: Copy , DecompressError :: Copy ( e) )
21+ }
22+ }
23+
1824#[ derive( Debug , Error ) ]
1925pub enum MultiDecompressErrorReason {
2026 #[ error( "Corrupt" ) ]
@@ -25,4 +31,6 @@ pub enum MultiDecompressErrorReason {
2531 header_index : usize ,
2632 compression_index : usize ,
2733 } ,
34+ #[ error( "Copy" ) ]
35+ Copy ,
2836}
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ pub fn decompress_multi(
3030 MultiDecompressErrorReason :: Corrupt
3131 } else {
3232 writer. get_mut ( ) . clear ( ) ;
33- std:: io:: copy ( & mut input, writer) . unwrap ( ) ;
33+ std:: io:: copy ( & mut input, writer) ? ;
3434 output = writer. get_mut ( ) . split ( ) ;
3535 MultiDecompressErrorReason :: Partial {
3636 partial_body : output,
Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ use thiserror::Error;
33
44#[ derive( Debug , Error ) ]
55pub enum DecompressError {
6+ // Error when copying partial decompressed data
7+ #[ error( "copy| {0}" ) ]
8+ Copy ( Error ) ,
69 #[ error( "brotli| {0}" ) ]
710 Brotli ( Error ) ,
811 #[ error( "deflate| {0}" ) ]
You can’t perform that action at this time.
0 commit comments