mirror of https://github.com/fafhrd91/actix-web
Prefer panic when 'ZstdDecoder::new' return 'Err'
This is not a real possible case looking at zstd 0.7
This commit is contained in:
parent
478c96e01f
commit
0054e6610d
|
@ -46,10 +46,9 @@ where
|
|||
ContentEncoding::Gzip => Some(ContentDecoder::Gzip(Box::new(
|
||||
GzDecoder::new(Writer::new()),
|
||||
))),
|
||||
ContentEncoding::Zstd => match ZstdDecoder::new(Writer::new()) {
|
||||
Ok(decoder) => Some(ContentDecoder::Zstd(Box::new(decoder))),
|
||||
Err(_) => None,
|
||||
},
|
||||
ContentEncoding::Zstd => Some(ContentDecoder::Zstd(Box::new(
|
||||
ZstdDecoder::new(Writer::new()).expect("Fail to create zstd decoder"),
|
||||
))),
|
||||
_ => None,
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue