diff options
Diffstat (limited to 'components/script/dom/htmlscriptelement.rs')
-rw-r--r-- | components/script/dom/htmlscriptelement.rs | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index 2e8453d994c..5d8f06c276a 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -473,9 +473,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLScriptElement> { } fn after_set_attr(&self, attr: JSRef<Attr>) { - match self.super_type() { - Some(ref s) => s.after_set_attr(attr), - _ => (), + if let Some(ref s) = self.super_type() { + s.after_set_attr(attr); } let node: JSRef<Node> = NodeCast::from_ref(*self); if attr.local_name() == &atom!("src") && !self.parser_inserted.get() && node.is_in_doc() { @@ -484,9 +483,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLScriptElement> { } fn child_inserted(&self, child: JSRef<Node>) { - match self.super_type() { - Some(ref s) => s.child_inserted(child), - _ => (), + if let Some(ref s) = self.super_type() { + s.child_inserted(child); } let node: JSRef<Node> = NodeCast::from_ref(*self); if !self.parser_inserted.get() && node.is_in_doc() { @@ -495,9 +493,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLScriptElement> { } fn bind_to_tree(&self, tree_in_doc: bool) { - match self.super_type() { - Some(ref s) => s.bind_to_tree(tree_in_doc), - _ => () + if let Some(ref s) = self.super_type() { + s.bind_to_tree(tree_in_doc); } if tree_in_doc && !self.parser_inserted.get() { @@ -507,9 +504,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLScriptElement> { fn cloning_steps(&self, copy: JSRef<Node>, maybe_doc: Option<JSRef<Document>>, clone_children: CloneChildrenFlag) { - match self.super_type() { - Some(ref s) => s.cloning_steps(copy, maybe_doc, clone_children), - _ => (), + if let Some(ref s) = self.super_type() { + s.cloning_steps(copy, maybe_doc, clone_children); } // https://whatwg.org/html/#already-started |