Rustfmt has changed its default style :/

This commit is contained in:
Simon Sapin 2018-12-14 08:31:30 +01:00
parent 82fc6d9f49
commit be69f9c3e6
207 changed files with 1200 additions and 1339 deletions

View file

@ -261,10 +261,11 @@ where
let iter = selector.iter_from(selector.len() - from_offset);
debug_assert!(
iter.clone().next().is_some() ||
(from_offset != selector.len() && matches!(
selector.combinator_at_parse_order(from_offset),
Combinator::SlotAssignment | Combinator::PseudoElement
)),
(from_offset != selector.len() &&
matches!(
selector.combinator_at_parse_order(from_offset),
Combinator::SlotAssignment | Combinator::PseudoElement
)),
"Got the math wrong: {:?} | {:?} | {} {}",
selector,
selector.iter_raw_match_order().as_slice(),
@ -454,11 +455,9 @@ where
context.current_host.is_some(),
"Should not be trying to match slotted rules in a non-shadow-tree context"
);
debug_assert!(
element
.assigned_slot()
.map_or(true, |s| s.is_html_slot_element())
);
debug_assert!(element
.assigned_slot()
.map_or(true, |s| s.is_html_slot_element()));
let scope = context.current_host?;
let mut current_slot = element.assigned_slot()?;
while current_slot.containing_shadow_host().unwrap().opaque() != scope {
@ -674,9 +673,9 @@ where
Component::Combinator(_) => unreachable!(),
Component::Slotted(ref selector) => {
// <slots> are never flattened tree slottables.
!element.is_html_slot_element() && element.assigned_slot().is_some() && context
.shared
.nest(|context| {
!element.is_html_slot_element() &&
element.assigned_slot().is_some() &&
context.shared.nest(|context| {
matches_complex_selector(selector.iter(), element, context, flags_setter)
})
},

View file

@ -449,9 +449,7 @@ where
ref local_name,
never_matches,
..
}
if !never_matches =>
{
} if !never_matches => {
if !visitor.visit_attribute_selector(
&NamespaceConstraint::Specific(&namespace_empty_string::<Impl>()),
local_name,
@ -459,7 +457,7 @@ where
) {
return false;
}
}
},
AttributeOther(ref attr_selector) if !attr_selector.never_matches => {
let empty_string;
let namespace = match attr_selector.namespace() {
@ -1366,7 +1364,7 @@ where
SelectorParseErrorKind::DanglingCombinator
} else {
SelectorParseErrorKind::EmptySelector
}))
}));
},
};
@ -1634,7 +1632,7 @@ where
OptionalQName::None(t) => {
return Err(input.new_custom_error(
SelectorParseErrorKind::NoQualifiedNameInAttributeSelector(t),
))
));
},
OptionalQName::Some(_, None) => unreachable!(),
OptionalQName::Some(ns, Some(ln)) => {
@ -1691,7 +1689,7 @@ where
Ok(t) => {
return Err(location.new_custom_error(
SelectorParseErrorKind::UnexpectedTokenInAttributeSelector(t.clone()),
))
));
},
};
@ -1768,11 +1766,12 @@ impl AttributeFlags {
AttributeFlags::CaseSensitive => ParsedCaseSensitivity::ExplicitCaseSensitive,
AttributeFlags::AsciiCaseInsensitive => ParsedCaseSensitivity::AsciiCaseInsensitive,
AttributeFlags::CaseSensitivityDependsOnName => {
if !have_namespace && include!(concat!(
env!("OUT_DIR"),
"/ascii_case_insensitive_html_attributes.rs"
))
.contains(local_name)
if !have_namespace &&
include!(concat!(
env!("OUT_DIR"),
"/ascii_case_insensitive_html_attributes.rs"
))
.contains(local_name)
{
ParsedCaseSensitivity::AsciiCaseInsensitiveIfInHtmlElementInHtmlDocument
} else {
@ -1961,7 +1960,7 @@ where
&Token::Ident(ref name) => name.clone(),
t => {
return Err(location
.new_custom_error(SelectorParseErrorKind::NoIdentForPseudo(t.clone())))
.new_custom_error(SelectorParseErrorKind::NoIdentForPseudo(t.clone())));
},
};