mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Use try syntax for Option where appropriate
This commit is contained in:
parent
fe16c1d5c3
commit
2d45e9d2da
19 changed files with 65 additions and 180 deletions
|
@ -108,10 +108,7 @@ impl WrappedHttpResponse {
|
|||
}
|
||||
|
||||
fn content_encoding(&self) -> Option<Encoding> {
|
||||
let encodings = match self.headers().get::<ContentEncoding>() {
|
||||
Some(&ContentEncoding(ref encodings)) => encodings,
|
||||
None => return None,
|
||||
};
|
||||
let &ContentEncoding(ref encodings) = self.headers().get()?;
|
||||
if encodings.contains(&Encoding::Gzip) {
|
||||
Some(Encoding::Gzip)
|
||||
} else if encodings.contains(&Encoding::Deflate) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue