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:
Ms2ger 2015-04-11 21:30:56 +02:00
parent f017a4459c
commit bbe494acde

View file

@ -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) {