From 479a42a980e77ffc17559fd0e2a86fb4b6f3d6e8 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Thu, 25 Feb 2021 09:11:54 +0100 Subject: [PATCH] Reformat with rustfmt 1.4.36-nightly (7de6968 2021-02-07) --- components/script/dom/treewalker.rs | 2 +- components/style/gecko/selector_parser.rs | 11 ++++++----- components/style/servo/selector_parser.rs | 4 +++- components/style/values/generics/image.rs | 8 ++++++-- components/style/values/specified/font.rs | 16 ++++++++++++---- components/style/values/specified/motion.rs | 4 +++- 6 files changed, 31 insertions(+), 14 deletions(-) diff --git a/components/script/dom/treewalker.rs b/components/script/dom/treewalker.rs index 7d23d81bcf0..86aa97466a7 100644 --- a/components/script/dom/treewalker.rs +++ b/components/script/dom/treewalker.rs @@ -467,7 +467,7 @@ impl<'a> Iterator for &'a TreeWalker { // which cannot produce an Err result. { unreachable!() - }, + } } } } diff --git a/components/style/gecko/selector_parser.rs b/components/style/gecko/selector_parser.rs index fd0494fa4b4..64e62badf3b 100644 --- a/components/style/gecko/selector_parser.rs +++ b/components/style/gecko/selector_parser.rs @@ -198,11 +198,12 @@ impl NonTSPseudoClass { /// revalidation. pub fn needs_cache_revalidation(&self) -> bool { self.state_flag().is_empty() && - !matches!(*self, - // :-moz-any is handled by the revalidation visitor walking - // the things inside it; it does not need to cause - // revalidation on its own. - NonTSPseudoClass::MozAny(_) | + !matches!( + *self, + // :-moz-any is handled by the revalidation visitor walking + // the things inside it; it does not need to cause + // revalidation on its own. + NonTSPseudoClass::MozAny(_) | // :dir() depends on state only, but doesn't use state_flag // because its semantics don't quite match. Nevertheless, it // doesn't need cache revalidation, because we already compare diff --git a/components/style/servo/selector_parser.rs b/components/style/servo/selector_parser.rs index a3a3ca7c2b8..66e87b339d4 100644 --- a/components/style/servo/selector_parser.rs +++ b/components/style/servo/selector_parser.rs @@ -29,7 +29,9 @@ use style_traits::{ParseError, StyleParseErrorKind}; /// A pseudo-element, both public and private. /// /// 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)] #[repr(usize)] pub enum PseudoElement { diff --git a/components/style/values/generics/image.rs b/components/style/values/generics/image.rs index 6f550bc21f6..9376cad2c2e 100644 --- a/components/style/values/generics/image.rs +++ b/components/style/values/generics/image.rs @@ -102,7 +102,9 @@ pub enum GenericGradient< 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)] /// Whether we used the modern notation or the compatibility `-webkit`, `-moz` prefixes. pub enum GradientCompatMode { @@ -129,7 +131,9 @@ pub enum GenericEndingShape { pub use self::GenericEndingShape as EndingShape; /// A circle shape. -#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem)] +#[derive( + Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem, +)] #[repr(C, u8)] pub enum GenericCircle { /// A circle radius. diff --git a/components/style/values/specified/font.rs b/components/style/values/specified/font.rs index 6fee8c2e770..49368548f98 100644 --- a/components/style/values/specified/font.rs +++ b/components/style/values/specified/font.rs @@ -79,7 +79,9 @@ pub const MAX_FONT_WEIGHT: f32 = 1000.; /// A specified font-weight value. /// /// 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 { /// `` Absolute(AbsoluteFontWeight), @@ -317,7 +319,9 @@ impl SpecifiedFontStyle { } /// 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)] pub enum FontStyle { Specified(SpecifiedFontStyle), @@ -366,7 +370,9 @@ pub enum FontStretch { } /// 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)] pub enum FontStretchKeyword { 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 pub enum FontSizeAdjust { /// None variant diff --git a/components/style/values/specified/motion.rs b/components/style/values/specified/motion.rs index 7831b78afe6..944a0110840 100644 --- a/components/style/values/specified/motion.rs +++ b/components/style/values/specified/motion.rs @@ -102,7 +102,9 @@ impl Parse for OffsetPath { } /// 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)] pub enum OffsetRotateDirection { /// Unspecified direction keyword.