Reformat with rustfmt 1.4.36-nightly (7de6968 2021-02-07)

This commit is contained in:
Simon Sapin 2021-02-25 09:11:54 +01:00
parent 2dd3c05479
commit 479a42a980
6 changed files with 31 additions and 14 deletions

View file

@ -467,7 +467,7 @@ impl<'a> Iterator for &'a TreeWalker {
// which cannot produce an Err result. // which cannot produce an Err result.
{ {
unreachable!() unreachable!()
}, }
} }
} }
} }

View file

@ -198,11 +198,12 @@ impl NonTSPseudoClass {
/// revalidation. /// revalidation.
pub fn needs_cache_revalidation(&self) -> bool { pub fn needs_cache_revalidation(&self) -> bool {
self.state_flag().is_empty() && self.state_flag().is_empty() &&
!matches!(*self, !matches!(
// :-moz-any is handled by the revalidation visitor walking *self,
// the things inside it; it does not need to cause // :-moz-any is handled by the revalidation visitor walking
// revalidation on its own. // the things inside it; it does not need to cause
NonTSPseudoClass::MozAny(_) | // revalidation on its own.
NonTSPseudoClass::MozAny(_) |
// :dir() depends on state only, but doesn't use state_flag // :dir() depends on state only, but doesn't use state_flag
// because its semantics don't quite match. Nevertheless, it // because its semantics don't quite match. Nevertheless, it
// doesn't need cache revalidation, because we already compare // doesn't need cache revalidation, because we already compare

View file

@ -29,7 +29,9 @@ use style_traits::{ParseError, StyleParseErrorKind};
/// A pseudo-element, both public and private. /// A pseudo-element, both public and private.
/// ///
/// NB: If you add to this list, be sure to update `each_simple_pseudo_element` too. /// NB: If you add to this list, be sure to update `each_simple_pseudo_element` too.
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, MallocSizeOf, PartialEq, Serialize, ToShmem)] #[derive(
Clone, Copy, Debug, Deserialize, Eq, Hash, MallocSizeOf, PartialEq, Serialize, ToShmem,
)]
#[allow(missing_docs)] #[allow(missing_docs)]
#[repr(usize)] #[repr(usize)]
pub enum PseudoElement { pub enum PseudoElement {

View file

@ -102,7 +102,9 @@ pub enum GenericGradient<
pub use self::GenericGradient as Gradient; pub use self::GenericGradient as Gradient;
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem)] #[derive(
Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem,
)]
#[repr(u8)] #[repr(u8)]
/// Whether we used the modern notation or the compatibility `-webkit`, `-moz` prefixes. /// Whether we used the modern notation or the compatibility `-webkit`, `-moz` prefixes.
pub enum GradientCompatMode { pub enum GradientCompatMode {
@ -129,7 +131,9 @@ pub enum GenericEndingShape<NonNegativeLength, NonNegativeLengthPercentage> {
pub use self::GenericEndingShape as EndingShape; pub use self::GenericEndingShape as EndingShape;
/// A circle shape. /// A circle shape.
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem)] #[derive(
Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem,
)]
#[repr(C, u8)] #[repr(C, u8)]
pub enum GenericCircle<NonNegativeLength> { pub enum GenericCircle<NonNegativeLength> {
/// A circle radius. /// A circle radius.

View file

@ -79,7 +79,9 @@ pub const MAX_FONT_WEIGHT: f32 = 1000.;
/// A specified font-weight value. /// A specified font-weight value.
/// ///
/// https://drafts.csswg.org/css-fonts-4/#propdef-font-weight /// https://drafts.csswg.org/css-fonts-4/#propdef-font-weight
#[derive(Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)] #[derive(
Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem,
)]
pub enum FontWeight { pub enum FontWeight {
/// `<font-weight-absolute>` /// `<font-weight-absolute>`
Absolute(AbsoluteFontWeight), Absolute(AbsoluteFontWeight),
@ -317,7 +319,9 @@ impl SpecifiedFontStyle {
} }
/// The specified value of the `font-style` property. /// The specified value of the `font-style` property.
#[derive(Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)] #[derive(
Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem,
)]
#[allow(missing_docs)] #[allow(missing_docs)]
pub enum FontStyle { pub enum FontStyle {
Specified(SpecifiedFontStyle), Specified(SpecifiedFontStyle),
@ -366,7 +370,9 @@ pub enum FontStretch {
} }
/// A keyword value for `font-stretch`. /// A keyword value for `font-stretch`.
#[derive(Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)] #[derive(
Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem,
)]
#[allow(missing_docs)] #[allow(missing_docs)]
pub enum FontStretchKeyword { pub enum FontStretchKeyword {
Normal, Normal,
@ -727,7 +733,9 @@ impl Parse for FamilyName {
} }
} }
#[derive(Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)] #[derive(
Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem,
)]
/// Preserve the readability of text when font fallback occurs /// Preserve the readability of text when font fallback occurs
pub enum FontSizeAdjust { pub enum FontSizeAdjust {
/// None variant /// None variant

View file

@ -102,7 +102,9 @@ impl Parse for OffsetPath {
} }
/// The direction of offset-rotate. /// The direction of offset-rotate.
#[derive(Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)] #[derive(
Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem,
)]
#[repr(u8)] #[repr(u8)]
pub enum OffsetRotateDirection { pub enum OffsetRotateDirection {
/// Unspecified direction keyword. /// Unspecified direction keyword.