Bug 1534726 - Reformat recent style system changes.
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 12 Mar 2019 17:02:19 +0100
changeset 521577 0d875c3ec155
parent 521576 0133ea3cd321
child 521578 52d4cd296bae
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1534726
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1534726 - Reformat recent style system changes.
servo/components/selectors/parser.rs
servo/components/style/custom_properties.rs
servo/components/style/gecko/media_queries.rs
servo/components/style/gecko/wrapper.rs
servo/components/style/gecko_bindings/sugar/ns_style_coord.rs
servo/components/style/rule_tree/mod.rs
servo/components/style/stylesheets/origin.rs
servo/components/style/values/animated/svg.rs
servo/components/style/values/computed/mod.rs
servo/components/style/values/computed/svg.rs
servo/components/style/values/computed/text.rs
servo/components/style/values/computed/transform.rs
servo/components/style/values/generics/mod.rs
servo/components/style/values/generics/text.rs
servo/components/style/values/generics/transform.rs
servo/components/style/values/specified/calc.rs
servo/components/style/values/specified/color.rs
servo/components/style/values/specified/length.rs
servo/components/style/values/specified/mod.rs
servo/components/style/values/specified/svg.rs
servo/components/style/values/specified/time.rs
servo/components/style_derive/cg.rs
--- a/servo/components/selectors/parser.rs
+++ b/servo/components/selectors/parser.rs
@@ -1954,18 +1954,19 @@ where
                 }
 
                 let location = input.current_source_location();
                 // TODO(emilio): Functional pseudo-classes too?
                 // We don't need it for now.
                 let name = match input.next_including_whitespace()? {
                     &Token::Ident(ref name) => name.clone(),
                     t => {
-                        return Err(location
-                            .new_custom_error(SelectorParseErrorKind::NoIdentForPseudo(t.clone())));
+                        return Err(location.new_custom_error(
+                            SelectorParseErrorKind::NoIdentForPseudo(t.clone()),
+                        ));
                     },
                 };
 
                 let pseudo_class = P::parse_non_ts_pseudo_class(parser, location, name.clone())?;
                 if !p.supports_pseudo_class(&pseudo_class) {
                     return Err(input.new_custom_error(
                         SelectorParseErrorKind::UnsupportedPseudoClassOrElement(name),
                     ));
--- a/servo/components/style/custom_properties.rs
+++ b/servo/components/style/custom_properties.rs
@@ -510,21 +510,17 @@ impl<'a> CustomPropertiesBuilder<'a> {
             may_have_cycles: false,
             custom_properties: None,
             inherited,
             environment,
         }
     }
 
     /// Cascade a given custom property declaration.
-    pub fn cascade(
-        &mut self,
-        declaration: &'a CustomDeclaration,
-        origin: Origin,
-    ) {
+    pub fn cascade(&mut self, declaration: &'a CustomDeclaration, origin: Origin) {
         let CustomDeclaration {
             ref name,
             ref value,
         } = *declaration;
 
         if self.reverted.borrow_for_origin(&origin).contains(&name) {
             return;
         }
--- a/servo/components/style/gecko/media_queries.rs
+++ b/servo/components/style/gecko/media_queries.rs
@@ -111,20 +111,17 @@ impl Device {
     /// element.
     pub fn animation_name_may_be_referenced(&self, name: &KeyframesName) -> bool {
         let pc = match self.pres_context() {
             Some(pc) => pc,
             None => return false,
         };
 
         unsafe {
-            bindings::Gecko_AnimationNameMayBeReferencedFromStyle(
-                pc,
-                name.as_atom().as_ptr(),
-            )
+            bindings::Gecko_AnimationNameMayBeReferencedFromStyle(pc, name.as_atom().as_ptr())
         }
     }
 
     /// Returns the default computed values as a reference, in order to match
     /// Servo.
     pub fn default_computed_values(&self) -> &ComputedValues {
         &self.default_values
     }
@@ -164,17 +161,22 @@ impl Device {
     pub fn document(&self) -> &structs::Document {
         unsafe { &*self.document }
     }
 
     /// Gets the pres context associated with this document.
     #[inline]
     pub fn pres_context(&self) -> Option<&structs::nsPresContext> {
         unsafe {
-            self.document().mPresShell.as_ref()?.mPresContext.mRawPtr.as_ref()
+            self.document()
+                .mPresShell
+                .as_ref()?
+                .mPresContext
+                .mRawPtr
+                .as_ref()
         }
     }
 
     /// Gets the preference stylesheet prefs for our document.
     #[inline]
     pub fn pref_sheet_prefs(&self) -> &structs::PreferenceSheet_Prefs {
         unsafe { &*bindings::Gecko_GetPrefSheetPrefs(self.document()) }
     }
@@ -263,19 +265,18 @@ impl Device {
 
     /// Returns whether document colors are enabled.
     #[inline]
     pub fn use_document_colors(&self) -> bool {
         let doc = self.document();
         if doc.mIsBeingUsedAsImage() {
             return true;
         }
-        let document_color_use = unsafe {
-            structs::StaticPrefs_sVarCache_browser_display_document_color_use
-        };
+        let document_color_use =
+            unsafe { structs::StaticPrefs_sVarCache_browser_display_document_color_use };
         let prefs = self.pref_sheet_prefs();
         match document_color_use {
             1 => true,
             2 => prefs.mIsChrome,
             _ => !prefs.mUseAccessibilityTheme,
         }
     }
 
--- a/servo/components/style/gecko/wrapper.rs
+++ b/servo/components/style/gecko/wrapper.rs
@@ -1241,18 +1241,17 @@ impl<'le> TElement for GeckoElement<'le>
     }
 
     #[inline]
     fn as_node(&self) -> Self::ConcreteNode {
         unsafe { GeckoNode(&*(self.0 as *const _ as *const RawGeckoNode)) }
     }
 
     fn owner_doc_matches_for_testing(&self, device: &Device) -> bool {
-        self.as_node().owner_doc().0 as *const structs::Document ==
-            device.document() as *const _
+        self.as_node().owner_doc().0 as *const structs::Document == device.document() as *const _
     }
 
     fn style_attribute(&self) -> Option<ArcBorrow<Locked<PropertyDeclarationBlock>>> {
         if !self.may_have_style_attribute() {
             return None;
         }
 
         let declarations = unsafe { Gecko_GetStyleAttrDeclarationBlock(self.0) };
--- a/servo/components/style/gecko_bindings/sugar/ns_style_coord.rs
+++ b/servo/components/style/gecko_bindings/sugar/ns_style_coord.rs
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
 
 //! Rust helpers for Gecko's `nsStyleCoord`.
 
 use crate::gecko_bindings::bindings;
+use crate::gecko_bindings::structs::nsStyleSides;
 use crate::gecko_bindings::structs::{nsStyleCoord, nsStyleCoord_Calc, nsStyleCoord_CalcValue};
-use crate::gecko_bindings::structs::nsStyleSides;
 use crate::gecko_bindings::structs::{nsStyleUnion, nsStyleUnit, nscoord};
 use std::mem;
 
 impl nsStyleCoord {
     #[inline]
     /// Get a `null` nsStyleCoord.
     pub fn null() -> Self {
         // Can't construct directly because it has private fields
--- a/servo/components/style/rule_tree/mod.rs
+++ b/servo/components/style/rule_tree/mod.rs
@@ -6,17 +6,17 @@
 
 //! The rule tree.
 
 use crate::applicable_declarations::ApplicableDeclarationList;
 #[cfg(feature = "gecko")]
 use crate::gecko::selector_parser::PseudoElement;
 use crate::properties::{Importance, LonghandIdSet, PropertyDeclarationBlock};
 use crate::shared_lock::{Locked, SharedRwLockReadGuard, StylesheetGuards};
-use crate::stylesheets::{StyleRule, Origin};
+use crate::stylesheets::{Origin, StyleRule};
 use crate::thread_state;
 #[cfg(feature = "gecko")]
 use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
 use servo_arc::{Arc, ArcBorrow, ArcUnion, ArcUnionBorrow};
 use smallvec::SmallVec;
 use std::io::{self, Write};
 use std::mem;
 use std::ptr;
@@ -658,20 +658,18 @@ impl CascadeLevel {
             Importance::Normal
         }
     }
 
     /// Returns the cascade origin of the rule.
     #[inline]
     pub fn origin(&self) -> Origin {
         match *self {
-            CascadeLevel::UAImportant |
-            CascadeLevel::UANormal => Origin::UserAgent,
-            CascadeLevel::UserImportant |
-            CascadeLevel::UserNormal => Origin::User,
+            CascadeLevel::UAImportant | CascadeLevel::UANormal => Origin::UserAgent,
+            CascadeLevel::UserImportant | CascadeLevel::UserNormal => Origin::User,
             CascadeLevel::PresHints |
             CascadeLevel::InnerShadowNormal |
             CascadeLevel::SameTreeAuthorNormal |
             CascadeLevel::StyleAttributeNormal |
             CascadeLevel::SMILOverride |
             CascadeLevel::Animations |
             CascadeLevel::SameTreeAuthorImportant |
             CascadeLevel::StyleAttributeImportant |
--- a/servo/components/style/stylesheets/origin.rs
+++ b/servo/components/style/stylesheets/origin.rs
@@ -71,17 +71,21 @@ bitflags! {
 }
 
 impl OriginSet {
     /// Returns an iterator over the origins present in this `OriginSet`.
     ///
     /// See the `OriginSet` documentation for information about the order
     /// origins are iterated.
     pub fn iter(&self) -> OriginSetIterator {
-        OriginSetIterator { set: *self, cur: 0, rev: false }
+        OriginSetIterator {
+            set: *self,
+            cur: 0,
+            rev: false,
+        }
     }
 }
 
 impl From<Origin> for OriginSet {
     fn from(origin: Origin) -> Self {
         Self::from_bits_truncate(origin as u8)
     }
 }
--- a/servo/components/style/values/animated/svg.rs
+++ b/servo/components/style/values/animated/svg.rs
@@ -3,17 +3,17 @@
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
 
 //! Animation implementations for various SVG-related types.
 
 use super::{Animate, Procedure, ToAnimatedZero};
 use crate::properties::animated_properties::ListAnimation;
 use crate::values::animated::color::Color as AnimatedColor;
 use crate::values::computed::url::ComputedUrl;
-use crate::values::distance::{SquaredDistance, ComputeSquaredDistance};
+use crate::values::distance::{ComputeSquaredDistance, SquaredDistance};
 use crate::values::generics::svg::{SVGPaint, SVGStrokeDashArray};
 
 /// Animated SVGPaint.
 pub type IntermediateSVGPaint = SVGPaint<AnimatedColor, ComputedUrl>;
 
 impl ToAnimatedZero for IntermediateSVGPaint {
     #[inline]
     fn to_animated_zero(&self) -> Result<Self, ()> {
--- a/servo/components/style/values/computed/mod.rs
+++ b/servo/components/style/values/computed/mod.rs
@@ -71,17 +71,17 @@ pub use self::percentage::{NonNegativePe
 pub use self::position::{GridAutoFlow, GridTemplateAreas, Position, ZIndex};
 pub use self::rect::NonNegativeLengthOrNumberRect;
 pub use self::resolution::Resolution;
 pub use self::svg::MozContextProperties;
 pub use self::svg::{SVGLength, SVGOpacity, SVGPaint, SVGPaintKind};
 pub use self::svg::{SVGPaintOrder, SVGStrokeDashArray, SVGWidth};
 pub use self::table::XSpan;
 pub use self::text::{InitialLetter, LetterSpacing, LineHeight};
-pub use self::text::{OverflowWrap, TextOverflow, WordSpacing, WordBreak};
+pub use self::text::{OverflowWrap, TextOverflow, WordBreak, WordSpacing};
 pub use self::text::{TextAlign, TextEmphasisPosition, TextEmphasisStyle};
 pub use self::time::Time;
 pub use self::transform::{Rotate, Scale, Transform, TransformOperation};
 pub use self::transform::{TransformOrigin, TransformStyle, Translate};
 #[cfg(feature = "gecko")]
 pub use self::ui::CursorImage;
 pub use self::ui::{Cursor, MozForceBrokenImageIcon, UserSelect};
 pub use super::specified::{BorderStyle, TextDecorationLine};
--- a/servo/components/style/values/computed/svg.rs
+++ b/servo/components/style/values/computed/svg.rs
@@ -52,19 +52,17 @@ impl SVGLength {
 
 /// An non-negative wrapper of SVGLength.
 pub type SVGWidth = generic::SVGLength<NonNegativeLengthPercentage>;
 
 impl SVGWidth {
     /// `1px`.
     pub fn one() -> Self {
         use crate::values::generics::NonNegative;
-        generic::SVGLength::LengthPercentage(
-            NonNegative(LengthPercentage::one()),
-        )
+        generic::SVGLength::LengthPercentage(NonNegative(LengthPercentage::one()))
     }
 }
 
 /// [ <length> | <percentage> | <number> ]# | context-value
 pub type SVGStrokeDashArray = generic::SVGStrokeDashArray<NonNegativeLengthPercentage>;
 
 impl Default for SVGStrokeDashArray {
     fn default() -> Self {
--- a/servo/components/style/values/computed/text.rs
+++ b/servo/components/style/values/computed/text.rs
@@ -13,19 +13,19 @@ use crate::values::generics::text::LineH
 use crate::values::generics::text::Spacing;
 use crate::values::specified::text::{self as specified, TextOverflowSide};
 use crate::values::specified::text::{TextEmphasisFillMode, TextEmphasisShapeKeyword};
 use crate::values::{CSSFloat, CSSInteger};
 use crate::Zero;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ToCss};
 
-pub use crate::values::specified::{OverflowWrap, WordBreak};
 pub use crate::values::specified::TextAlignKeyword as TextAlign;
 pub use crate::values::specified::TextEmphasisPosition;
+pub use crate::values::specified::{OverflowWrap, WordBreak};
 
 /// A computed value for the `initial-letter` property.
 pub type InitialLetter = GenericInitialLetter<CSSFloat, CSSInteger>;
 
 /// A computed value for the `letter-spacing` property.
 #[repr(transparent)]
 #[derive(
     Animate,
--- a/servo/components/style/values/computed/transform.rs
+++ b/servo/components/style/values/computed/transform.rs
@@ -587,19 +587,17 @@ impl Translate {
                 Some(generic::TransformOperation::Translate3D(tx, ty, tz))
             },
         }
     }
 
     /// Convert Translate to TransformOperation.
     pub fn from_transform_operation(operation: &TransformOperation) -> Translate {
         match *operation {
-            generic::TransformOperation::Translate(tx, ty) => {
-                generic::Translate::Translate(tx, ty)
-            },
+            generic::TransformOperation::Translate(tx, ty) => generic::Translate::Translate(tx, ty),
             generic::TransformOperation::Translate3D(tx, ty, tz) => {
                 generic::Translate::Translate3D(tx, ty, tz)
             },
             _ => unreachable!("Found unexpected value for translate"),
         }
     }
 }
 
--- a/servo/components/style/values/generics/mod.rs
+++ b/servo/components/style/values/generics/mod.rs
@@ -210,16 +210,28 @@ impl<T: Zero> Zero for NonNegative<T> {
     ToAnimatedZero,
     ToComputedValue,
     ToCss,
 )]
 pub struct GreaterThanOrEqualToOne<T>(pub T);
 
 /// A clip rect for clip and image-region
 #[allow(missing_docs)]
-#[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToAnimatedZero, ToComputedValue, ToCss)]
+#[derive(
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
+)]
 #[css(function = "rect", comma)]
 pub struct ClipRect<LengthOrAuto> {
     pub top: LengthOrAuto,
     pub right: LengthOrAuto,
     pub bottom: LengthOrAuto,
     pub left: LengthOrAuto,
 }
--- a/servo/components/style/values/generics/text.rs
+++ b/servo/components/style/values/generics/text.rs
@@ -24,19 +24,17 @@ impl<N, I> InitialLetter<N, I> {
     /// Returns `normal`.
     #[inline]
     pub fn normal() -> Self {
         InitialLetter::Normal
     }
 }
 
 /// A generic spacing value for the `letter-spacing` and `word-spacing` properties.
-#[derive(
-    Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss,
-)]
+#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
 pub enum Spacing<Value> {
     /// `normal`
     Normal,
     /// `<value>`
     Value(Value),
 }
 
 impl<Value> Spacing<Value> {
--- a/servo/components/style/values/generics/transform.rs
+++ b/servo/components/style/values/generics/transform.rs
@@ -132,17 +132,20 @@ where
     /// skewX(angle)
     #[css(function = "skewX")]
     SkewX(Angle),
     /// skewY(angle)
     #[css(function = "skewY")]
     SkewY(Angle),
     /// translate(x, y) or translate(x)
     #[css(comma, function)]
-    Translate(LengthPercentage, #[css(skip_if = "Zero::is_zero")] LengthPercentage),
+    Translate(
+        LengthPercentage,
+        #[css(skip_if = "Zero::is_zero")] LengthPercentage,
+    ),
     /// translateX(x)
     #[css(function = "translateX")]
     TranslateX(LengthPercentage),
     /// translateY(y)
     #[css(function = "translateY")]
     TranslateY(LengthPercentage),
     /// translateZ(z)
     #[css(function = "translateZ")]
@@ -632,17 +635,24 @@ impl<Number: ToCss + PartialEq> ToCss fo
                 dest.write_char(' ')?;
                 z.to_css(dest)
             },
         }
     }
 }
 
 #[derive(
-    Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToAnimatedZero, ToComputedValue, ToCss
+    Clone,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
 )]
 /// A value of the `translate` property
 ///
 /// https://drafts.csswg.org/css-transforms-2/#individual-transform-serialization:
 ///
 /// If a 2d translation is specified, the property must serialize with only one
 /// or two values (per usual, if the second value is 0px, the default, it must
 /// be omitted when serializing).
@@ -655,17 +665,20 @@ impl<Number: ToCss + PartialEq> ToCss fo
 /// <https://drafts.csswg.org/css-transforms-2/#individual-transforms>
 pub enum Translate<LengthPercentage, Length>
 where
     LengthPercentage: Zero,
 {
     /// 'none'
     None,
     /// '<length-percentage>' or '<length-percentage> <length-percentage>'
-    Translate(LengthPercentage, #[css(skip_if = "Zero::is_zero")] LengthPercentage),
+    Translate(
+        LengthPercentage,
+        #[css(skip_if = "Zero::is_zero")] LengthPercentage,
+    ),
     /// '<length-percentage> <length-percentage> <length>'
     Translate3D(LengthPercentage, LengthPercentage, Length),
 }
 
 #[allow(missing_docs)]
 #[derive(
     Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
 )]
--- a/servo/components/style/values/specified/calc.rs
+++ b/servo/components/style/values/specified/calc.rs
@@ -175,37 +175,43 @@ impl CalcNode {
             (
                 &Token::Dimension {
                     value, ref unit, ..
                 },
                 CalcUnit::LengthPercentage,
             ) => {
                 return NoCalcLength::parse_dimension(context, value, unit)
                     .map(CalcNode::Length)
-                    .map_err(|()| location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
+                    .map_err(|()| {
+                        location.new_custom_error(StyleParseErrorKind::UnspecifiedError)
+                    });
             },
             (
                 &Token::Dimension {
                     value, ref unit, ..
                 },
                 CalcUnit::Angle,
             ) => {
                 return Angle::parse_dimension(value, unit, /* from_calc = */ true)
                     .map(CalcNode::Angle)
-                    .map_err(|()| location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
+                    .map_err(|()| {
+                        location.new_custom_error(StyleParseErrorKind::UnspecifiedError)
+                    });
             },
             (
                 &Token::Dimension {
                     value, ref unit, ..
                 },
                 CalcUnit::Time,
             ) => {
                 return Time::parse_dimension(value, unit, /* from_calc = */ true)
                     .map(CalcNode::Time)
-                    .map_err(|()| location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
+                    .map_err(|()| {
+                        location.new_custom_error(StyleParseErrorKind::UnspecifiedError)
+                    });
             },
             (&Token::Percentage { unit_value, .. }, CalcUnit::LengthPercentage) |
             (&Token::Percentage { unit_value, .. }, CalcUnit::Percentage) => {
                 return Ok(CalcNode::Percentage(unit_value));
             },
             (&Token::ParenthesisBlock, _) => {},
             (&Token::Function(ref name), _) if name.eq_ignore_ascii_case("calc") => {},
             (t, _) => return Err(location.new_unexpected_token_error(t.clone())),
--- a/servo/components/style/values/specified/color.rs
+++ b/servo/components/style/values/specified/color.rs
@@ -269,18 +269,19 @@ impl Color {
                 int_value: Some(integer),
                 ref unit,
                 ..
             } => (integer, Some(unit)),
             Token::Ident(ref ident) => {
                 if ident.len() != 3 && ident.len() != 6 {
                     return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
                 }
-                return parse_hash_color(ident.as_bytes())
-                    .map_err(|()| location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
+                return parse_hash_color(ident.as_bytes()).map_err(|()| {
+                    location.new_custom_error(StyleParseErrorKind::UnspecifiedError)
+                });
             },
             ref t => {
                 return Err(location.new_unexpected_token_error(t.clone()));
             },
         };
         if value < 0 {
             return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
         }
--- a/servo/components/style/values/specified/length.rs
+++ b/servo/components/style/values/specified/length.rs
@@ -591,17 +591,19 @@ impl Length {
                         .map(Length::NoCalc)
                         .map_err(|()| location.new_unexpected_token_error(token.clone()));
                 },
                 Token::Number { value, .. } if num_context.is_ok(context.parsing_mode, value) => {
                     if value != 0. &&
                         !context.parsing_mode.allows_unitless_lengths() &&
                         !allow_quirks.allowed(context.quirks_mode)
                     {
-                        return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
+                        return Err(
+                            location.new_custom_error(StyleParseErrorKind::UnspecifiedError)
+                        );
                     }
                     return Ok(Length::NoCalc(NoCalcLength::Absolute(AbsoluteLength::Px(
                         value,
                     ))));
                 },
                 Token::Function(ref name) if name.eq_ignore_ascii_case("calc") => {},
                 ref token => return Err(location.new_unexpected_token_error(token.clone())),
             }
--- a/servo/components/style/values/specified/mod.rs
+++ b/servo/components/style/values/specified/mod.rs
@@ -647,17 +647,22 @@ impl ClipRect {
                 input.expect_comma()?;
                 left = parse_argument(context, input, allow_quirks)?;
             } else {
                 right = parse_argument(context, input, allow_quirks)?;
                 bottom = parse_argument(context, input, allow_quirks)?;
                 left = parse_argument(context, input, allow_quirks)?;
             }
 
-            Ok(ClipRect { top, right, bottom, left })
+            Ok(ClipRect {
+                top,
+                right,
+                bottom,
+                left,
+            })
         })
     }
 }
 
 /// rect(...) | auto
 pub type ClipRectOrAuto = Either<ClipRect, Auto>;
 
 impl ClipRectOrAuto {
--- a/servo/components/style/values/specified/svg.rs
+++ b/servo/components/style/values/specified/svg.rs
@@ -1,19 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
 
 //! Specified types for SVG properties.
 
 use crate::parser::{Parse, ParserContext};
 use crate::values::generics::svg as generic;
-use crate::values::specified::AllowQuirks;
 use crate::values::specified::color::Color;
 use crate::values::specified::url::SpecifiedUrl;
+use crate::values::specified::AllowQuirks;
 use crate::values::specified::LengthPercentage;
 use crate::values::specified::{NonNegativeLengthPercentage, Opacity};
 use crate::values::CustomIdent;
 use cssparser::Parser;
 use std::fmt::{self, Write};
 use style_traits::{CommaWithSpace, CssWriter, ParseError, Separator};
 use style_traits::{StyleParseErrorKind, ToCss};
 
@@ -47,47 +47,42 @@ pub fn is_context_value_enabled() -> boo
 
 macro_rules! parse_svg_length {
     ($ty:ty, $lp:ty) => {
         impl Parse for $ty {
             fn parse<'i, 't>(
                 context: &ParserContext,
                 input: &mut Parser<'i, 't>,
             ) -> Result<Self, ParseError<'i>> {
-                if let Ok(lp) = input.try(|i| {
-                    <$lp>::parse_quirky(context, i, AllowQuirks::Always)
-                }) {
-                    return Ok(generic::SVGLength::LengthPercentage(lp))
+                if let Ok(lp) = input.try(|i| <$lp>::parse_quirky(context, i, AllowQuirks::Always))
+                {
+                    return Ok(generic::SVGLength::LengthPercentage(lp));
                 }
 
                 try_match_ident_ignore_ascii_case! { input,
                     "context-value" if is_context_value_enabled() => {
                         Ok(generic::SVGLength::ContextValue)
                     },
                 }
             }
         }
-    }
+    };
 }
 
 parse_svg_length!(SVGLength, LengthPercentage);
 parse_svg_length!(SVGWidth, NonNegativeLengthPercentage);
 
 impl Parse for SVGStrokeDashArray {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         if let Ok(values) = input.try(|i| {
             CommaWithSpace::parse(i, |i| {
-                NonNegativeLengthPercentage::parse_quirky(
-                    context,
-                    i,
-                    AllowQuirks::Always,
-                )
+                NonNegativeLengthPercentage::parse_quirky(context, i, AllowQuirks::Always)
             })
         }) {
             return Ok(generic::SVGStrokeDashArray::Values(values));
         }
 
         try_match_ident_ignore_ascii_case! { input,
             "context-value" if is_context_value_enabled() => {
                 Ok(generic::SVGStrokeDashArray::ContextValue)
--- a/servo/components/style/values/specified/time.rs
+++ b/servo/components/style/values/specified/time.rs
@@ -88,18 +88,19 @@ impl Time {
             // Note that we generally pass ParserContext to is_ok() to check
             // that the ParserMode of the ParserContext allows all numeric
             // values for SMIL regardless of clamping_mode, but in this Time
             // value case, the value does not animate for SMIL at all, so we use
             // ParsingMode::DEFAULT directly.
             Ok(&Token::Dimension {
                 value, ref unit, ..
             }) if clamping_mode.is_ok(ParsingMode::DEFAULT, value) => {
-                return Time::parse_dimension(value, unit, /* from_calc = */ false)
-                    .map_err(|()| location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
+                return Time::parse_dimension(value, unit, /* from_calc = */ false).map_err(|()| {
+                    location.new_custom_error(StyleParseErrorKind::UnspecifiedError)
+                });
             },
             Ok(&Token::Function(ref name)) if name.eq_ignore_ascii_case("calc") => {},
             Ok(t) => return Err(location.new_unexpected_token_error(t.clone())),
             Err(e) => return Err(e.into()),
         }
         match input.parse_nested_block(|i| CalcNode::parse_time(context, i)) {
             Ok(time) if clamping_mode.is_ok(ParsingMode::DEFAULT, time.seconds) => Ok(time),
             _ => Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError)),
--- a/servo/components/style_derive/cg.rs
+++ b/servo/components/style_derive/cg.rs
@@ -65,19 +65,19 @@ pub fn propagate_clauses_to_output_type(
         if generics.type_params().any(|param| param.ident == *ident) {
             extra_bounds.push(ty.clone());
         }
     }
 
     for bound in extra_bounds {
         let ty = bound.bounded_ty;
         let bounds = bound.bounds;
-        where_clause.predicates.push(
-            parse_quote!(<#ty as #trait_path>::#trait_output: #bounds),
-        )
+        where_clause
+            .predicates
+            .push(parse_quote!(<#ty as #trait_path>::#trait_output: #bounds))
     }
 }
 
 pub fn add_predicate(where_clause: &mut Option<syn::WhereClause>, pred: WherePredicate) {
     where_clause
         .get_or_insert(parse_quote!(where))
         .predicates
         .push(pred);