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

fix clippy warning on nightly (#2088)

* fix clippy warning on nightly
This commit is contained in:
fakeshadow
2021-03-19 04:25:35 -07:00
committed by GitHub
parent 78fcd0237a
commit 351286486c
11 changed files with 30 additions and 52 deletions

View File

@ -197,22 +197,23 @@ impl AcceptEncoding {
/// Parse a raw Accept-Encoding header value into an ordered list.
pub fn parse(raw: &str, encoding: ContentEncoding) -> ContentEncoding {
let mut encodings: Vec<_> = raw
let mut encodings = raw
.replace(' ', "")
.split(',')
.map(|l| AcceptEncoding::new(l))
.collect();
.flatten()
.collect::<Vec<_>>();
encodings.sort();
for enc in encodings {
if let Some(enc) = enc {
if encoding == ContentEncoding::Auto {
return enc.encoding;
} else if encoding == enc.encoding {
return encoding;
}
if encoding == ContentEncoding::Auto {
return enc.encoding;
} else if encoding == enc.encoding {
return encoding;
}
}
ContentEncoding::Identity
}
}