diff options
Diffstat (limited to 'components/script/dom/htmloptionelement.rs')
-rw-r--r-- | components/script/dom/htmloptionelement.rs | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/components/script/dom/htmloptionelement.rs b/components/script/dom/htmloptionelement.rs index def3d358e8d..d50c832eda4 100644 --- a/components/script/dom/htmloptionelement.rs +++ b/components/script/dom/htmloptionelement.rs @@ -129,9 +129,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLOptionElement> { } 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); } match attr.local_name() { @@ -139,15 +138,14 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLOptionElement> { let node: JSRef<Node> = NodeCast::from_ref(*self); node.set_disabled_state(true); node.set_enabled_state(false); - } + }, _ => () } } fn before_remove_attr(&self, attr: JSRef<Attr>) { - match self.super_type() { - Some(ref s) => s.before_remove_attr(attr), - _ => () + if let Some(ref s) = self.super_type() { + s.before_remove_attr(attr); } match attr.local_name() { @@ -162,9 +160,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLOptionElement> { } 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); } let node: JSRef<Node> = NodeCast::from_ref(*self); @@ -172,9 +169,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLOptionElement> { } fn unbind_from_tree(&self, tree_in_doc: bool) { - match self.super_type() { - Some(ref s) => s.unbind_from_tree(tree_in_doc), - _ => (), + if let Some(ref s) = self.super_type() { + s.unbind_from_tree(tree_in_doc); } let node: JSRef<Node> = NodeCast::from_ref(*self); |