mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue