aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlimageelement.rs
diff options
context:
space:
mode:
authorZack Slayton <zack.slayton@gmail.com>2015-03-08 18:55:52 -0400
committerZack Slayton <zack.slayton@gmail.com>2015-03-10 09:18:55 -0400
commit08ac0766eda2340008642e86799ea2cb1ef6e59f (patch)
treee53ed9f42ff9fa45603fa04ec0d772430ee7fd1e /components/script/dom/htmlimageelement.rs
parent09c36de8f1db54fdd2514f4b66c3a3753719a1bb (diff)
downloadservo-08ac0766eda2340008642e86799ea2cb1ef6e59f.tar.gz
servo-08ac0766eda2340008642e86799ea2cb1ef6e59f.zip
Use new `if let` syntax wherever possible. Fixes #4153.
Diffstat (limited to 'components/script/dom/htmlimageelement.rs')
-rw-r--r--components/script/dom/htmlimageelement.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs
index 6b2f0b3dc2f..c3655ce1897 100644
--- a/components/script/dom/htmlimageelement.rs
+++ b/components/script/dom/htmlimageelement.rs
@@ -183,9 +183,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLImageElement> {
}
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() {
@@ -199,9 +198,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLImageElement> {
}
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() {