1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-07-01 00:44:26 +02:00

non exhaustive content encoding (#2377)

This commit is contained in:
Rob Ede
2021-09-01 09:53:26 +01:00
committed by GitHub
parent ddc8c16cb3
commit 93112644d3
10 changed files with 35 additions and 60 deletions

View File

@ -1,7 +1,6 @@
//! Stream decoders.
use std::{
convert::TryFrom,
future::Future,
io::{self, Write as _},
pin::Pin,
@ -81,7 +80,7 @@ where
let encoding = headers
.get(&CONTENT_ENCODING)
.and_then(|val| val.to_str().ok())
.and_then(|x| ContentEncoding::try_from(x).ok())
.and_then(|x| x.parse().ok())
.unwrap_or(ContentEncoding::Identity);
Self::new(stream, encoding)