mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Use if let remove_inline_style_property.
It makes little sense to use map() in a case where we don't care about the return value.
This commit is contained in:
parent
f017a4459c
commit
bbe494acde
1 changed files with 2 additions and 2 deletions
|
@ -507,7 +507,7 @@ impl<'a> ElementHelpers<'a> for JSRef<'a, Element> {
|
||||||
|
|
||||||
fn remove_inline_style_property(self, property: DOMString) {
|
fn remove_inline_style_property(self, property: DOMString) {
|
||||||
let mut inline_declarations = self.style_attribute.borrow_mut();
|
let mut inline_declarations = self.style_attribute.borrow_mut();
|
||||||
inline_declarations.as_mut().map(|declarations| {
|
if let &mut Some(ref mut declarations) = &mut *inline_declarations {
|
||||||
let index = declarations.normal
|
let index = declarations.normal
|
||||||
.iter()
|
.iter()
|
||||||
.position(|decl| decl.name() == property);
|
.position(|decl| decl.name() == property);
|
||||||
|
@ -523,7 +523,7 @@ impl<'a> ElementHelpers<'a> for JSRef<'a, Element> {
|
||||||
declarations.important.make_unique().remove(index);
|
declarations.important.make_unique().remove(index);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_inline_style(self, property_decl: PropertyDeclaration, style_priority: StylePriority) {
|
fn update_inline_style(self, property_decl: PropertyDeclaration, style_priority: StylePriority) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue