Rustfmt and fix tidy on recent changes.

This commit is contained in:
Emilio Cobos Álvarez 2019-06-23 13:03:00 +02:00
parent 6eedebe2c8
commit ed2e9ce482
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
16 changed files with 78 additions and 57 deletions

View file

@ -110,10 +110,7 @@ impl<Impl: SelectorImpl> SelectorBuilder<Impl> {
if parsed_part {
flags |= SelectorFlags::HAS_PART;
}
self.build_with_specificity_and_flags(SpecificityAndFlags {
specificity,
flags,
})
self.build_with_specificity_and_flags(SpecificityAndFlags { specificity, flags })
}
/// Builds with an explicit SpecificityAndFlags. This is separated from build() so
@ -208,9 +205,9 @@ bitflags! {
pub struct SpecificityAndFlags {
/// There are two free bits here, since we use ten bits for each specificity
/// kind (id, class, element).
pub (crate) specificity: u32,
pub(crate) specificity: u32,
/// There's padding after this field due to the size of the flags.
pub (crate) flags: SelectorFlags,
pub(crate) flags: SelectorFlags,
}
impl SpecificityAndFlags {

View file

@ -751,7 +751,11 @@ impl<Impl: SelectorImpl> Selector<Impl> {
/// Creates a Selector from a vec of Components, specified in parse order. Used in tests.
#[allow(unused)]
pub (crate) fn from_vec(vec: Vec<Component<Impl>>, specificity: u32, flags: SelectorFlags) -> Self {
pub(crate) fn from_vec(
vec: Vec<Component<Impl>>,
specificity: u32,
flags: SelectorFlags,
) -> Self {
let mut builder = SelectorBuilder::default();
for component in vec.into_iter() {
if let Some(combinator) = component.as_combinator() {
@ -760,10 +764,7 @@ impl<Impl: SelectorImpl> Selector<Impl> {
builder.push_simple_selector(component);
}
}
let spec = SpecificityAndFlags {
specificity,
flags,
};
let spec = SpecificityAndFlags { specificity, flags };
Selector(builder.build_with_specificity_and_flags(spec))
}