From 08ac0766eda2340008642e86799ea2cb1ef6e59f Mon Sep 17 00:00:00 2001 From: Zack Slayton Date: Sun, 8 Mar 2015 18:55:52 -0400 Subject: Use new `if let` syntax wherever possible. Fixes #4153. --- components/script/dom/htmlstyleelement.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'components/script/dom/htmlstyleelement.rs') diff --git a/components/script/dom/htmlstyleelement.rs b/components/script/dom/htmlstyleelement.rs index 945831a35b1..e3c64c45790 100644 --- a/components/script/dom/htmlstyleelement.rs +++ b/components/script/dom/htmlstyleelement.rs @@ -69,9 +69,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLStyleElement> { } fn child_inserted(&self, child: JSRef) { - 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 = NodeCast::from_ref(*self); @@ -81,9 +80,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLStyleElement> { } 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 { -- cgit v1.2.3