mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
clippy: Fix option_map_or_none warnings (#31983)
This commit is contained in:
parent
66878fb834
commit
b228d7869d
2 changed files with 2 additions and 2 deletions
|
@ -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> {
|
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),
|
"anonymous" => Some(CorsSettings::Anonymous),
|
||||||
"use-credentials" => Some(CorsSettings::UseCredentials),
|
"use-credentials" => Some(CorsSettings::UseCredentials),
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
|
|
|
@ -310,7 +310,7 @@ impl HTMLSelectElementMethods for HTMLSelectElement {
|
||||||
fn NamedItem(&self, name: DOMString) -> Option<DomRoot<HTMLOptionElement>> {
|
fn NamedItem(&self, name: DOMString) -> Option<DomRoot<HTMLOptionElement>> {
|
||||||
self.Options()
|
self.Options()
|
||||||
.NamedGetter(name)
|
.NamedGetter(name)
|
||||||
.map_or(None, DomRoot::downcast::<HTMLOptionElement>)
|
.and_then(DomRoot::downcast::<HTMLOptionElement>)
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#dom-select-remove
|
// https://html.spec.whatwg.org/multipage/#dom-select-remove
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue