Short-circuit and unindent

This commit is contained in:
Simon Sapin 2017-05-18 12:32:10 +02:00
parent 76166bce58
commit c06e574c18

View file

@ -427,8 +427,8 @@ fn matches_simple_selector<E, F>(
never_matches, never_matches,
} => { } => {
if never_matches { if never_matches {
false return false
} else { }
let is_html = element.is_html_element_in_html_document(); let is_html = element.is_html_element_in_html_document();
element.attr_matches( element.attr_matches(
&NamespaceConstraint::Specific(&::parser::namespace_empty_string::<E::Impl>()), &NamespaceConstraint::Specific(&::parser::namespace_empty_string::<E::Impl>()),
@ -440,11 +440,10 @@ fn matches_simple_selector<E, F>(
} }
) )
} }
}
Component::AttributeOther(ref attr_sel) => { Component::AttributeOther(ref attr_sel) => {
if attr_sel.never_matches { if attr_sel.never_matches {
return false return false
} else { }
let is_html = element.is_html_element_in_html_document(); let is_html = element.is_html_element_in_html_document();
element.attr_matches( element.attr_matches(
&attr_sel.namespace(), &attr_sel.namespace(),
@ -465,7 +464,6 @@ fn matches_simple_selector<E, F>(
} }
) )
} }
}
Component::NonTSPseudoClass(ref pc) => { Component::NonTSPseudoClass(ref pc) => {
element.match_non_ts_pseudo_class(pc, context, flags_setter) element.match_non_ts_pseudo_class(pc, context, flags_setter)
} }