mirror of
https://github.com/servo/servo
synced 2026-04-27 18:07:52 +02:00
Use new if let syntax wherever possible. Fixes #4153.
This commit is contained in:
@@ -66,28 +66,28 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLTableSectionElement> {
|
||||
}
|
||||
|
||||
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() {
|
||||
&atom!("bgcolor") => {
|
||||
self.background_color.set(str::parse_legacy_color(attr.value().as_slice()).ok())
|
||||
}
|
||||
_ => {}
|
||||
self.background_color.set(str::parse_legacy_color(attr.value().as_slice()).ok());
|
||||
},
|
||||
_ => ()
|
||||
}
|
||||
}
|
||||
|
||||
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() {
|
||||
&atom!("bgcolor") => self.background_color.set(None),
|
||||
_ => {}
|
||||
&atom!("bgcolor") => {
|
||||
self.background_color.set(None);
|
||||
},
|
||||
_ => ()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user