diff options
author | Simon Wülker <simon.wuelker@arcor.de> | 2024-09-16 12:03:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-16 10:03:52 +0000 |
commit | 7df30f3788a14baa590c9123f5e1616ccfe0a0f0 (patch) | |
tree | 491bdb4447ec1a24c66d1ad91f7c1678ee71b9e1 /components/script/stylesheet_loader.rs | |
parent | 236cae9ce53019036710032a980966542a64fbce (diff) | |
download | servo-7df30f3788a14baa590c9123f5e1616ccfe0a0f0.tar.gz servo-7df30f3788a14baa590c9123f5e1616ccfe0a0f0.zip |
Replace .map_or(false with Option::is_some_and (#33468)
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Diffstat (limited to 'components/script/stylesheet_loader.rs')
-rw-r--r-- | components/script/stylesheet_loader.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/components/script/stylesheet_loader.rs b/components/script/stylesheet_loader.rs index 079566d1971..006bc10b8df 100644 --- a/components/script/stylesheet_loader.rs +++ b/components/script/stylesheet_loader.rs @@ -128,7 +128,7 @@ impl FetchResponseListener for StylesheetContext { Some(meta) => meta, None => return, }; - let is_css = metadata.content_type.map_or(false, |ct| { + let is_css = metadata.content_type.is_some_and(|ct| { let mime: Mime = ct.into_inner().into(); mime.type_() == mime::TEXT && mime.subtype() == mime::CSS }); @@ -202,7 +202,7 @@ impl FetchResponseListener for StylesheetContext { // FIXME: Revisit once consensus is reached at: // https://github.com/whatwg/html/issues/1142 - successful = metadata.status.map_or(false, |(code, _)| code == 200); + successful = metadata.status.is_some_and(|(code, _)| code == 200); } let owner = elem |