File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -2431,23 +2431,20 @@ unsafe fn ZSTD_decompressBlock_deprecated(
24312431 dctx : & mut ZSTD_DCtx ,
24322432 mut dst : Writer < ' _ > ,
24332433 src : Reader < ' _ > ,
2434- ) -> size_t {
2434+ ) -> Result < size_t , Error > {
24352435 dctx. isFrameDecompression = false ;
24362436 ZSTD_checkContinuity ( dctx, dst. as_ptr_range ( ) ) ;
24372437
24382438 // FIXME: can src and dst overlap in this case?
2439- let dSize = match ZSTD_decompressBlock_internal_help (
2439+ let dSize = ZSTD_decompressBlock_internal_help (
24402440 dctx,
24412441 dst. subslice ( ..) ,
24422442 src. as_slice ( ) ,
24432443 StreamingOperation :: NotStreaming ,
2444- ) {
2445- Ok ( size) => size,
2446- Err ( err) => return err. to_error_code ( ) ,
2447- } ;
2444+ ) ?;
24482445
24492446 dctx. previousDstEnd = dst. as_ptr ( ) . byte_add ( dSize) . cast :: < c_void > ( ) ;
2450- dSize
2447+ Ok ( dSize)
24512448}
24522449
24532450#[ cfg_attr( feature = "export-symbols" , export_name = crate :: prefix!( ZSTD_decompressBlock ) ) ]
@@ -2462,6 +2459,7 @@ pub unsafe extern "C" fn ZSTD_decompressBlock(
24622459 let src = Reader :: from_raw_parts ( src. cast :: < u8 > ( ) , srcSize) ;
24632460
24642461 ZSTD_decompressBlock_deprecated ( dctx. as_mut ( ) . unwrap ( ) , dst, src)
2462+ . unwrap_or_else ( |err| err. to_error_code ( ) )
24652463}
24662464
24672465#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments