aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmltextareaelement.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/htmltextareaelement.rs')
-rw-r--r--components/script/dom/htmltextareaelement.rs34
1 files changed, 12 insertions, 22 deletions
diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs
index ed7fb71a954..0e7b6de2642 100644
--- a/components/script/dom/htmltextareaelement.rs
+++ b/components/script/dom/htmltextareaelement.rs
@@ -224,9 +224,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLTextAreaElement> {
}
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() {
@@ -252,9 +251,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLTextAreaElement> {
}
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() {
@@ -275,9 +273,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLTextAreaElement> {
}
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);
@@ -293,9 +290,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLTextAreaElement> {
}
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);
@@ -307,11 +303,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLTextAreaElement> {
}
fn child_inserted(&self, child: JSRef<Node>) {
- match self.super_type() {
- Some(s) => {
- s.child_inserted(child);
- }
- _ => (),
+ if let Some(s) = self.super_type() {
+ s.child_inserted(child);
}
if child.is_text() && !self.value_changed.get() {
@@ -321,11 +314,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLTextAreaElement> {
// copied and modified from htmlinputelement.rs
fn handle_event(&self, event: JSRef<Event>) {
- match self.super_type() {
- Some(s) => {
- s.handle_event(event);
- }
- _ => (),
+ if let Some(s) = self.super_type() {
+ s.handle_event(event);
}
if "click" == event.Type().as_slice() && !event.DefaultPrevented() {