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(
|
ContentEncoding::Gzip => Some(ContentDecoder::Gzip(Box::new(
|
||||||
GzDecoder::new(Writer::new()),
|
GzDecoder::new(Writer::new()),
|
||||||
))),
|
))),
|
||||||
ContentEncoding::Zstd => match ZstdDecoder::new(Writer::new()) {
|
ContentEncoding::Zstd => Some(ContentDecoder::Zstd(Box::new(
|
||||||
Ok(decoder) => Some(ContentDecoder::Zstd(Box::new(decoder))),
|
ZstdDecoder::new(Writer::new()).expect("Fail to create zstd decoder"),
|
||||||
Err(_) => None,
|
))),
|
||||||
},
|
|
||||||
_ => None,
|
_ => None,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue