clippy: Fix option_map_or_none warnings (#31983)

This commit is contained in:
Oluwatobi Sofela 2024-04-03 12:39:52 +01:00 committed by GitHub
parent 66878fb834
commit b228d7869d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -3955,7 +3955,7 @@ pub(crate) fn referrer_policy_for_element(element: &Element) -> Option<ReferrerP
}
pub(crate) fn cors_setting_for_element(element: &Element) -> Option<CorsSettings> {
reflect_cross_origin_attribute(element).map_or(None, |attr| match &*attr {
reflect_cross_origin_attribute(element).and_then(|attr| match &*attr {
"anonymous" => Some(CorsSettings::Anonymous),
"use-credentials" => Some(CorsSettings::UseCredentials),
_ => unreachable!(),