aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmllegendelement.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/htmllegendelement.rs')
-rw-r--r--components/script/dom/htmllegendelement.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/components/script/dom/htmllegendelement.rs b/components/script/dom/htmllegendelement.rs
index 58c193fd6d5..04e8636bb03 100644
--- a/components/script/dom/htmllegendelement.rs
+++ b/components/script/dom/htmllegendelement.rs
@@ -75,10 +75,7 @@ impl VirtualMethods for HTMLLegendElement {
impl HTMLLegendElementMethods for HTMLLegendElement {
// https://html.spec.whatwg.org/multipage/#dom-legend-form
fn GetForm(&self) -> Option<DomRoot<HTMLFormElement>> {
- let parent = match self.upcast::<Node>().GetParentElement() {
- Some(parent) => parent,
- None => return None,
- };
+ let parent = self.upcast::<Node>().GetParentElement()?;
if parent.is::<HTMLFieldSetElement>() {
return self.form_owner();
}