mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Use new if let
syntax wherever possible. Fixes #4153.
This commit is contained in:
parent
09c36de8f1
commit
08ac0766ed
25 changed files with 178 additions and 262 deletions
|
@ -84,9 +84,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLSelectElement> {
|
|||
}
|
||||
|
||||
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() {
|
||||
|
@ -100,9 +99,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLSelectElement> {
|
|||
}
|
||||
|
||||
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() {
|
||||
|
@ -117,9 +115,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLSelectElement> {
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -127,9 +124,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLSelectElement> {
|
|||
}
|
||||
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue