aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmllegendelement.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2017-12-09 20:26:48 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2017-12-09 20:26:48 +0100
commit339d633906fe721a6ff259daad1ba407ab2fed45 (patch)
tree7598d9409b3ebcc3666bbcb7647a6b40952abcd3 /components/script/dom/htmllegendelement.rs
parentdbf0183b0fae56da5dcfa06a89843cff721390a3 (diff)
downloadservo-339d633906fe721a6ff259daad1ba407ab2fed45.tar.gz
servo-339d633906fe721a6ff259daad1ba407ab2fed45.zip
script: Use ? on option more often.
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();
}