Use 'match' instead of 'if'.

This commit is contained in:
Tetsuharu OHZEKI 2013-11-12 21:11:52 +09:00
parent ad45bd509e
commit 072ff20140

View file

@ -252,8 +252,11 @@ impl<'self> Element {
local_name: DOMString,
value: DOMString) {
if "style" == local_name && *namespace == namespace::Null {
self.style_attribute = Some(style::parse_style_attribute(value));
match local_name.as_slice() {
"style" if *namespace == namespace::Null => {
self.style_attribute = Some(style::parse_style_attribute(value))
}
_ => ()
}
// TODO: update owner document's id hashmap for `document.getElementById()`