aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlstyleelement.rs
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-03-10 07:51:50 -0600
committerbors-servo <metajack+bors@gmail.com>2015-03-10 07:51:50 -0600
commitd31e80f89490afe4863574c062f34b2a0df43bae (patch)
tree98dadb54d54b2b8e4efd97a53ec76fefd02b0a08 /components/script/dom/htmlstyleelement.rs
parentfd1bb49a65dd998c8ef9890a1576aaf62ddfdba1 (diff)
parent08ac0766eda2340008642e86799ea2cb1ef6e59f (diff)
downloadservo-d31e80f89490afe4863574c062f34b2a0df43bae.tar.gz
servo-d31e80f89490afe4863574c062f34b2a0df43bae.zip
auto merge of #5182 : zslayton/servo/master, r=jdm
Opening this PR to invite feedback. Of the many `match` statement candidates for conversion to `if let`, several included `if` guards. Since `if let` doesn't support this syntax, I used nested if statements. If this is undesirable, say the word and I can revert those cases to `match`.
Diffstat (limited to 'components/script/dom/htmlstyleelement.rs')
-rw-r--r--components/script/dom/htmlstyleelement.rs10
1 files changed, 4 insertions, 6 deletions
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<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);
@@ -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 {