Bug 1518045 - Rustfmt recent changes.
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 07 Jan 2019 00:00:55 +0100
changeset 452673 b144051398358a6f3b296d473abee52cdcab3544
parent 452672 91e7ea77c846ae753fb3a28ab81598d2dc7ac865
child 452674 28134941aac4065784b991962cad17f9ac71208d
push id35325
push useropoprus@mozilla.com
push dateMon, 07 Jan 2019 09:30:40 +0000
treeherdermozilla-central@0dcf945b3871 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1518045
milestone66.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 1518045 - Rustfmt recent changes.
servo/components/style/gecko/conversions.rs
servo/components/style/gecko/data.rs
servo/components/style/gecko/media_features.rs
servo/components/style/gecko/values.rs
servo/components/style/gecko/wrapper.rs
servo/components/style/gecko_bindings/sugar/origin_flags.rs
servo/components/style/invalidation/element/restyle_hints.rs
servo/components/style/rule_collector.rs
servo/components/style/stylist.rs
servo/components/style/values/animated/mod.rs
servo/components/style/values/computed/border.rs
servo/components/style/values/computed/mod.rs
servo/components/style/values/specified/basic_shape.rs
servo/components/style/values/specified/border.rs
servo/components/style/values/specified/length.rs
servo/components/style/values/specified/mod.rs
--- a/servo/components/style/gecko/conversions.rs
+++ b/servo/components/style/gecko/conversions.rs
@@ -19,21 +19,21 @@ use crate::gecko_bindings::sugar::ns_sty
 use crate::stylesheets::{Origin, RulesMutateError};
 use crate::values::computed::image::LineDirection;
 use crate::values::computed::transform::Matrix3D;
 use crate::values::computed::url::ComputedImageUrl;
 use crate::values::computed::{Angle, CalcLengthOrPercentage, Gradient, Image};
 use crate::values::computed::{Integer, LengthOrPercentage};
 use crate::values::computed::{LengthOrPercentageOrAuto, NonNegativeLengthOrPercentageOrAuto};
 use crate::values::computed::{Percentage, TextAlign};
-use crate::values::generics::NonNegative;
 use crate::values::generics::box_::VerticalAlign;
 use crate::values::generics::grid::{TrackListValue, TrackSize};
 use crate::values::generics::image::{CompatMode, GradientItem, Image as GenericImage};
 use crate::values::generics::rect::Rect;
+use crate::values::generics::NonNegative;
 use app_units::Au;
 use std::f32::consts::PI;
 
 impl From<CalcLengthOrPercentage> for nsStyleCoord_CalcValue {
     fn from(other: CalcLengthOrPercentage) -> nsStyleCoord_CalcValue {
         let has_percentage = other.percentage.is_some();
         nsStyleCoord_CalcValue {
             mLength: other.unclamped_length().to_i32_au(),
@@ -672,21 +672,21 @@ pub mod basic_shape {
     use crate::values::computed::border::{BorderCornerRadius, BorderRadius};
     use crate::values::computed::length::LengthOrPercentage;
     use crate::values::computed::motion::OffsetPath;
     use crate::values::computed::position;
     use crate::values::computed::url::ComputedUrl;
     use crate::values::generics::basic_shape::{
         BasicShape as GenericBasicShape, InsetRect, Polygon,
     };
-    use crate::values::generics::NonNegative;
     use crate::values::generics::basic_shape::{Circle, Ellipse, Path, PolygonCoord};
     use crate::values::generics::basic_shape::{GeometryBox, ShapeBox, ShapeSource};
     use crate::values::generics::border::BorderRadius as GenericBorderRadius;
     use crate::values::generics::rect::Rect;
+    use crate::values::generics::NonNegative;
     use crate::values::specified::SVGPathData;
     use std::borrow::Borrow;
 
     impl StyleShapeSource {
         /// Convert StyleShapeSource to ShapeSource except URL and Image
         /// types.
         fn into_shape_source<ReferenceBox, ImageOrUrl>(
             &self,
@@ -836,20 +836,27 @@ pub mod basic_shape {
             }
         }
     }
 
     impl<'a> From<&'a nsStyleCorners> for BorderRadius {
         fn from(other: &'a nsStyleCorners) -> Self {
             let get_corner = |index| {
                 BorderCornerRadius::new(
-                    NonNegative(LengthOrPercentage::from_gecko_style_coord(&other.data_at(index))
-                        .expect("<border-radius> should be a length, percentage, or calc value")),
-                    NonNegative(LengthOrPercentage::from_gecko_style_coord(&other.data_at(index + 1))
-                        .expect("<border-radius> should be a length, percentage, or calc value")),
+                    NonNegative(
+                        LengthOrPercentage::from_gecko_style_coord(&other.data_at(index)).expect(
+                            "<border-radius> should be a length, percentage, or calc value",
+                        ),
+                    ),
+                    NonNegative(
+                        LengthOrPercentage::from_gecko_style_coord(&other.data_at(index + 1))
+                            .expect(
+                                "<border-radius> should be a length, percentage, or calc value",
+                            ),
+                    ),
                 )
             };
 
             GenericBorderRadius {
                 top_left: get_corner(0),
                 top_right: get_corner(2),
                 bottom_right: get_corner(4),
                 bottom_left: get_corner(6),
--- a/servo/components/style/gecko/data.rs
+++ b/servo/components/style/gecko/data.rs
@@ -2,18 +2,18 @@
  * 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/. */
 
 //! Data needed to style a Gecko document.
 
 use crate::context::QuirksMode;
 use crate::dom::TElement;
 use crate::gecko_bindings::bindings::{self, RawServoStyleSet};
+use crate::gecko_bindings::structs::{RawGeckoPresContextBorrowed, ServoStyleSetSizes};
 use crate::gecko_bindings::structs::{StyleSheet as DomStyleSheet, StyleSheetInfo};
-use crate::gecko_bindings::structs::{RawGeckoPresContextBorrowed, ServoStyleSetSizes};
 use crate::gecko_bindings::sugar::ownership::{HasArcFFI, HasBoxFFI, HasFFI, HasSimpleFFI};
 use crate::invalidation::media_queries::{MediaListKey, ToMediaListKey};
 use crate::media_queries::{Device, MediaList};
 use crate::properties::ComputedValues;
 use crate::selector_parser::SnapshotMap;
 use crate::shared_lock::{Locked, SharedRwLockReadGuard, StylesheetGuards};
 use crate::stylesheets::{CssRule, Origin, StylesheetContents, StylesheetInDocument};
 use crate::stylist::Stylist;
@@ -145,18 +145,17 @@ impl PerDocumentStyleData {
     /// Create a dummy `PerDocumentStyleData`.
     pub fn new(pres_context: RawGeckoPresContextBorrowed) -> Self {
         let device = Device::new(pres_context);
 
         // FIXME(emilio, tlin): How is this supposed to work with XBL? This is
         // right now not always honored, see bug 1405543...
         //
         // Should we just force XBL Stylists to be NoQuirks?
-        let quirks_mode =
-            unsafe { (*device.pres_context().mDocument.mRawPtr).mCompatMode };
+        let quirks_mode = unsafe { (*device.pres_context().mDocument.mRawPtr).mCompatMode };
 
         PerDocumentStyleData(AtomicRefCell::new(PerDocumentStyleDataImpl {
             stylist: Stylist::new(device, quirks_mode.into()),
         }))
     }
 
     /// Get an immutable reference to this style data.
     pub fn borrow(&self) -> AtomicRef<PerDocumentStyleDataImpl> {
@@ -187,22 +186,17 @@ impl PerDocumentStyleDataImpl {
     /// Get the default computed values for this document.
     pub fn default_computed_values(&self) -> &Arc<ComputedValues> {
         self.stylist.device().default_computed_values_arc()
     }
 
     /// Returns whether visited styles are enabled.
     #[inline]
     pub fn visited_styles_enabled(&self) -> bool {
-        let doc = self
-            .stylist
-            .device()
-            .pres_context()
-            .mDocument
-            .mRawPtr;
+        let doc = self.stylist.device().pres_context().mDocument.mRawPtr;
         unsafe { bindings::Gecko_VisitedStylesEnabled(doc) }
     }
 
     /// Measure heap usage.
     pub fn add_size_of(&self, ops: &mut MallocSizeOfOps, sizes: &mut ServoStyleSetSizes) {
         self.stylist.add_size_of(ops, sizes);
     }
 }
--- a/servo/components/style/gecko/media_features.rs
+++ b/servo/components/style/gecko/media_features.rs
@@ -315,18 +315,17 @@ fn eval_overflow_block(device: &Device, 
     // If this ever changes, don't forget to change eval_overflow_inline too.
     let scrolling = device.media_type() != MediaType::print();
     let query_value = match query_value {
         Some(v) => v,
         None => return true,
     };
 
     match query_value {
-        OverflowBlock::None |
-        OverflowBlock::OptionalPaged => false,
+        OverflowBlock::None | OverflowBlock::OptionalPaged => false,
         OverflowBlock::Scroll => scrolling,
         OverflowBlock::Paged => !scrolling,
     }
 }
 
 #[derive(Clone, Copy, Debug, FromPrimitive, Parse, ToCss)]
 #[repr(u8)]
 enum OverflowInline {
--- a/servo/components/style/gecko/values.rs
+++ b/servo/components/style/gecko/values.rs
@@ -281,19 +281,17 @@ impl GeckoStyleCoordConvertible for Comp
                 if v == StyleShapeRadius::ClosestSide as u32 {
                     Some(ShapeRadius::ClosestSide)
                 } else if v == StyleShapeRadius::FarthestSide as u32 {
                     Some(ShapeRadius::FarthestSide)
                 } else {
                     None
                 }
             },
-            _ => {
-                GeckoStyleCoordConvertible::from_gecko_style_coord(coord).map(ShapeRadius::Length)
-            },
+            _ => GeckoStyleCoordConvertible::from_gecko_style_coord(coord).map(ShapeRadius::Length),
         }
     }
 }
 
 impl<T: GeckoStyleCoordConvertible> GeckoStyleCoordConvertible for Option<T> {
     fn to_gecko_style_coord<U: CoordDataMut>(&self, coord: &mut U) {
         if let Some(ref me) = *self {
             me.to_gecko_style_coord(coord);
--- a/servo/components/style/gecko/wrapper.rs
+++ b/servo/components/style/gecko/wrapper.rs
@@ -39,18 +39,18 @@ use crate::gecko_bindings::bindings::Gec
 use crate::gecko_bindings::bindings::Gecko_IsSignificantChild;
 use crate::gecko_bindings::bindings::Gecko_MatchLang;
 use crate::gecko_bindings::bindings::Gecko_UnsetDirtyStyleAttr;
 use crate::gecko_bindings::bindings::Gecko_UpdateAnimations;
 use crate::gecko_bindings::bindings::{Gecko_ElementState, Gecko_GetDocumentLWTheme};
 use crate::gecko_bindings::bindings::{Gecko_SetNodeFlags, Gecko_UnsetNodeFlags};
 use crate::gecko_bindings::structs;
 use crate::gecko_bindings::structs::nsChangeHint;
+use crate::gecko_bindings::structs::nsRestyleHint;
 use crate::gecko_bindings::structs::Document_DocumentTheme as DocumentTheme;
-use crate::gecko_bindings::structs::nsRestyleHint;
 use crate::gecko_bindings::structs::EffectCompositor_CascadeLevel as CascadeLevel;
 use crate::gecko_bindings::structs::ELEMENT_HANDLED_SNAPSHOT;
 use crate::gecko_bindings::structs::ELEMENT_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO;
 use crate::gecko_bindings::structs::ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO;
 use crate::gecko_bindings::structs::ELEMENT_HAS_SNAPSHOT;
 use crate::gecko_bindings::structs::NODE_DESCENDANTS_NEED_FRAMES;
 use crate::gecko_bindings::structs::NODE_NEEDS_FRAME;
 use crate::gecko_bindings::structs::{nsAtom, nsIContent, nsINode_BooleanFlag};
@@ -1238,20 +1238,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
-                .pres_context()
-                .mDocument
-                .mRawPtr
+            device.pres_context().mDocument.mRawPtr
     }
 
     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/origin_flags.rs
+++ b/servo/components/style/gecko_bindings/sugar/origin_flags.rs
@@ -5,17 +5,20 @@
 //! Helper to iterate over `OriginFlags` bits.
 
 use crate::gecko_bindings::structs::OriginFlags;
 use crate::stylesheets::OriginSet;
 
 /// Checks that the values for OriginFlags are the ones we expect.
 pub fn assert_flags_match() {
     use crate::stylesheets::origin::*;
-    debug_assert_eq!(OriginFlags::UserAgent.0, OriginSet::ORIGIN_USER_AGENT.bits());
+    debug_assert_eq!(
+        OriginFlags::UserAgent.0,
+        OriginSet::ORIGIN_USER_AGENT.bits()
+    );
     debug_assert_eq!(OriginFlags::Author.0, OriginSet::ORIGIN_AUTHOR.bits());
     debug_assert_eq!(OriginFlags::User.0, OriginSet::ORIGIN_USER.bits());
 }
 
 impl From<OriginFlags> for OriginSet {
     fn from(flags: OriginFlags) -> Self {
         Self::from_bits_truncate(flags.0)
     }
--- a/servo/components/style/invalidation/element/restyle_hints.rs
+++ b/servo/components/style/invalidation/element/restyle_hints.rs
@@ -200,23 +200,27 @@ impl From<nsRestyleHint> for RestyleHint
             "Handle later siblings manually if necessary plz."
         );
 
         if (raw.0 & (nsRestyleHint::eRestyle_Self.0 | nsRestyleHint::eRestyle_Subtree.0)) != 0 {
             raw.0 &= !nsRestyleHint::eRestyle_Self.0;
             hint.insert(RestyleHint::RESTYLE_SELF);
         }
 
-        if (raw.0 & (nsRestyleHint::eRestyle_Subtree.0 | nsRestyleHint::eRestyle_SomeDescendants.0)) != 0 {
+        if (raw.0 & (nsRestyleHint::eRestyle_Subtree.0 | nsRestyleHint::eRestyle_SomeDescendants.0)) !=
+            0
+        {
             raw.0 &= !nsRestyleHint::eRestyle_Subtree.0;
             raw.0 &= !nsRestyleHint::eRestyle_SomeDescendants.0;
             hint.insert(RestyleHint::RESTYLE_DESCENDANTS);
         }
 
-        if (raw.0 & (nsRestyleHint::eRestyle_ForceDescendants.0 | nsRestyleHint::eRestyle_Force.0)) != 0 {
+        if (raw.0 & (nsRestyleHint::eRestyle_ForceDescendants.0 | nsRestyleHint::eRestyle_Force.0)) !=
+            0
+        {
             raw.0 &= !nsRestyleHint::eRestyle_Force.0;
             hint.insert(RestyleHint::RECASCADE_SELF);
         }
 
         if (raw.0 & nsRestyleHint::eRestyle_ForceDescendants.0) != 0 {
             raw.0 &= !nsRestyleHint::eRestyle_ForceDescendants.0;
             hint.insert(RestyleHint::RECASCADE_DESCENDANTS);
         }
--- a/servo/components/style/rule_collector.rs
+++ b/servo/components/style/rule_collector.rs
@@ -255,18 +255,17 @@ where
             Some(s) => s,
             None => return,
         };
 
         self.matches_document_author_rules = false;
 
         let cascade_data = containing_shadow.style_data();
         let host = containing_shadow.host();
-        if let Some(map) = cascade_data.and_then(|data| data.normal_rules(self.pseudo_element))
-        {
+        if let Some(map) = cascade_data.and_then(|data| data.normal_rules(self.pseudo_element)) {
             self.collect_rules_in_shadow_tree(host, map, CascadeLevel::SameTreeAuthorNormal);
         }
     }
 
     /// Collects the rules for the :host pseudo-class.
     fn collect_host_rules(&mut self) {
         let shadow = match self.rule_hash_target.shadow_root() {
             Some(s) => s,
--- a/servo/components/style/stylist.rs
+++ b/servo/components/style/stylist.rs
@@ -12,17 +12,17 @@ use crate::font_metrics::FontMetricsProv
 #[cfg(feature = "gecko")]
 use crate::gecko_bindings::structs::{ServoStyleSetSizes, StyleRuleInclusion};
 use crate::invalidation::element::invalidation_map::InvalidationMap;
 use crate::invalidation::media_queries::{EffectiveMediaQueryResults, ToMediaListKey};
 use crate::media_queries::Device;
 use crate::properties::{self, CascadeMode, ComputedValues};
 use crate::properties::{AnimationRules, PropertyDeclarationBlock};
 use crate::rule_cache::{RuleCache, RuleCacheConditions};
-use crate::rule_collector::{RuleCollector, containing_shadow_ignoring_svg_use};
+use crate::rule_collector::{containing_shadow_ignoring_svg_use, RuleCollector};
 use crate::rule_tree::{CascadeLevel, RuleTree, ShadowCascadeOrder, StrongRuleNode, StyleSource};
 use crate::selector_map::{PrecomputedHashMap, PrecomputedHashSet, SelectorMap, SelectorMapEntry};
 use crate::selector_parser::{PerPseudoElementMap, PseudoElement, SelectorImpl, SnapshotMap};
 use crate::shared_lock::{Locked, SharedRwLockReadGuard, StylesheetGuards};
 use crate::stylesheet_set::{DataValidity, DocumentStylesheetSet, SheetRebuildKind};
 use crate::stylesheet_set::{DocumentStylesheetFlusher, SheetCollectionFlusher};
 use crate::stylesheets::keyframes_rule::KeyframesAnimation;
 use crate::stylesheets::viewport_rule::{self, MaybeNew, ViewportRule};
--- a/servo/components/style/values/animated/mod.rs
+++ b/servo/components/style/values/animated/mod.rs
@@ -8,18 +8,18 @@
 //! computed values and need yet another intermediate representation. This
 //! module's raison d'ĂȘtre is to ultimately contain all these types.
 
 use crate::properties::PropertyId;
 use crate::values::computed::length::CalcLengthOrPercentage;
 use crate::values::computed::url::ComputedUrl;
 use crate::values::computed::Angle as ComputedAngle;
 use crate::values::computed::Image;
+use crate::values::specified::SVGPathData;
 use crate::values::CSSFloat;
-use crate::values::specified::SVGPathData;
 use app_units::Au;
 use euclid::{Point2D, Size2D};
 use smallvec::SmallVec;
 use std::cmp;
 
 pub mod color;
 pub mod effects;
 mod font;
--- a/servo/components/style/values/computed/border.rs
+++ b/servo/components/style/values/computed/border.rs
@@ -1,33 +1,34 @@
 /* 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/. */
 
 //! Computed types for CSS values related to borders.
 
-use crate::values::generics::NonNegative;
-use crate::values::computed::length::{NonNegativeLengthOrPercentage, NonNegativeLength};
+use crate::values::computed::length::{NonNegativeLength, NonNegativeLengthOrPercentage};
 use crate::values::computed::{NonNegativeNumber, NonNegativeNumberOrPercentage};
 use crate::values::generics::border::BorderCornerRadius as GenericBorderCornerRadius;
 use crate::values::generics::border::BorderImageSideWidth as GenericBorderImageSideWidth;
 use crate::values::generics::border::BorderImageSlice as GenericBorderImageSlice;
 use crate::values::generics::border::BorderRadius as GenericBorderRadius;
 use crate::values::generics::border::BorderSpacing as GenericBorderSpacing;
 use crate::values::generics::rect::Rect;
 use crate::values::generics::size::Size;
+use crate::values::generics::NonNegative;
 use app_units::Au;
 
 pub use crate::values::specified::border::BorderImageRepeat;
 
 /// A computed value for the `border-image-width` property.
 pub type BorderImageWidth = Rect<BorderImageSideWidth>;
 
 /// A computed value for a single side of a `border-image-width` property.
-pub type BorderImageSideWidth = GenericBorderImageSideWidth<NonNegativeLengthOrPercentage, NonNegativeNumber>;
+pub type BorderImageSideWidth =
+    GenericBorderImageSideWidth<NonNegativeLengthOrPercentage, NonNegativeNumber>;
 
 /// A computed value for the `border-image-slice` property.
 pub type BorderImageSlice = GenericBorderImageSlice<NonNegativeNumberOrPercentage>;
 
 /// A computed value for the `border-radius` property.
 pub type BorderRadius = GenericBorderRadius<NonNegativeLengthOrPercentage>;
 
 /// A computed value for the `border-*-radius` longhand properties.
--- a/servo/components/style/values/computed/mod.rs
+++ b/servo/components/style/values/computed/mod.rs
@@ -541,17 +541,19 @@ impl From<GreaterThanOrEqualToOneNumber>
 pub enum NumberOrPercentage {
     Percentage(Percentage),
     Number(Number),
 }
 
 impl NumberOrPercentage {
     fn clamp_to_non_negative(self) -> Self {
         match self {
-            NumberOrPercentage::Percentage(p) => NumberOrPercentage::Percentage(p.clamp_to_non_negative()),
+            NumberOrPercentage::Percentage(p) => {
+                NumberOrPercentage::Percentage(p.clamp_to_non_negative())
+            },
             NumberOrPercentage::Number(n) => NumberOrPercentage::Number(n.max(0.)),
         }
     }
 }
 
 impl ToComputedValue for specified::NumberOrPercentage {
     type ComputedValue = NumberOrPercentage;
 
--- a/servo/components/style/values/specified/basic_shape.rs
+++ b/servo/components/style/values/specified/basic_shape.rs
@@ -11,18 +11,18 @@ use crate::parser::{Parse, ParserContext
 use crate::values::generics::basic_shape as generic;
 use crate::values::generics::basic_shape::{GeometryBox, Path, PolygonCoord};
 use crate::values::generics::basic_shape::{ShapeBox, ShapeSource};
 use crate::values::generics::rect::Rect;
 use crate::values::specified::border::BorderRadius;
 use crate::values::specified::image::Image;
 use crate::values::specified::position::{HorizontalPosition, Position, VerticalPosition};
 use crate::values::specified::url::SpecifiedUrl;
+use crate::values::specified::SVGPathData;
 use crate::values::specified::{LengthOrPercentage, NonNegativeLengthOrPercentage};
-use crate::values::specified::SVGPathData;
 use cssparser::Parser;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
 
 /// A specified alias for FillRule.
 pub use crate::values::generics::basic_shape::FillRule;
 
 /// A specified clipping shape.
--- a/servo/components/style/values/specified/border.rs
+++ b/servo/components/style/values/specified/border.rs
@@ -8,17 +8,17 @@ use crate::parser::{Parse, ParserContext
 use crate::values::computed::{self, Context, ToComputedValue};
 use crate::values::generics::border::BorderCornerRadius as GenericBorderCornerRadius;
 use crate::values::generics::border::BorderImageSideWidth as GenericBorderImageSideWidth;
 use crate::values::generics::border::BorderImageSlice as GenericBorderImageSlice;
 use crate::values::generics::border::BorderRadius as GenericBorderRadius;
 use crate::values::generics::border::BorderSpacing as GenericBorderSpacing;
 use crate::values::generics::rect::Rect;
 use crate::values::generics::size::Size;
-use crate::values::specified::length::{NonNegativeLengthOrPercentage, NonNegativeLength};
+use crate::values::specified::length::{NonNegativeLength, NonNegativeLengthOrPercentage};
 use crate::values::specified::{AllowQuirks, NonNegativeNumber, NonNegativeNumberOrPercentage};
 use cssparser::Parser;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ParseError, ToCss};
 
 /// A specified value for a single side of a `border-style` property.
 ///
 /// The order here corresponds to the integer values from the border conflict
@@ -73,17 +73,18 @@ pub enum BorderSideWidth {
     /// `<length>`
     Length(NonNegativeLength),
 }
 
 /// A specified value for the `border-image-width` property.
 pub type BorderImageWidth = Rect<BorderImageSideWidth>;
 
 /// A specified value for a single side of a `border-image-width` property.
-pub type BorderImageSideWidth = GenericBorderImageSideWidth<NonNegativeLengthOrPercentage, NonNegativeNumber>;
+pub type BorderImageSideWidth =
+    GenericBorderImageSideWidth<NonNegativeLengthOrPercentage, NonNegativeNumber>;
 
 /// A specified value for the `border-image-slice` property.
 pub type BorderImageSlice = GenericBorderImageSlice<NonNegativeNumberOrPercentage>;
 
 /// A specified value for the `border-radius` property.
 pub type BorderRadius = GenericBorderRadius<NonNegativeLengthOrPercentage>;
 
 /// A specified value for the `border-*-radius` longhand properties.
@@ -111,18 +112,17 @@ impl BorderSideWidth {
     }
 
     /// Parses, with quirks.
     pub fn parse_quirky<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
         allow_quirks: AllowQuirks,
     ) -> Result<Self, ParseError<'i>> {
-        if let Ok(length) =
-            input.try(|i| NonNegativeLength::parse_quirky(context, i, allow_quirks))
+        if let Ok(length) = input.try(|i| NonNegativeLength::parse_quirky(context, i, allow_quirks))
         {
             return Ok(BorderSideWidth::Length(length));
         }
         try_match_ident_ignore_ascii_case! { input,
             "thin" => Ok(BorderSideWidth::Thin),
             "medium" => Ok(BorderSideWidth::Medium),
             "thick" => Ok(BorderSideWidth::Thick),
         }
--- a/servo/components/style/values/specified/length.rs
+++ b/servo/components/style/values/specified/length.rs
@@ -720,17 +720,21 @@ impl NonNegativeLength {
 
     /// Parses a non-negative length, optionally with quirks.
     #[inline]
     pub fn parse_quirky<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
         allow_quirks: AllowQuirks,
     ) -> Result<Self, ParseError<'i>> {
-        Ok(NonNegative(Length::parse_non_negative_quirky(context, input, allow_quirks)?))
+        Ok(NonNegative(Length::parse_non_negative_quirky(
+            context,
+            input,
+            allow_quirks,
+        )?))
     }
 }
 
 /// Either a NonNegativeLength or the `auto` keyword.
 pub type NonNegativeLengthOrAuto = Either<NonNegativeLength, Auto>;
 
 /// A length or a percentage value.
 #[allow(missing_docs)]
--- a/servo/components/style/values/specified/mod.rs
+++ b/servo/components/style/values/specified/mod.rs
@@ -370,17 +370,19 @@ impl NonNegativeNumberOrPercentage {
     }
 }
 
 impl Parse for NonNegativeNumberOrPercentage {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        Ok(NonNegative(NumberOrPercentage::parse_non_negative(context, input)?))
+        Ok(NonNegative(NumberOrPercentage::parse_non_negative(
+            context, input,
+        )?))
     }
 }
 
 #[allow(missing_docs)]
 #[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd, SpecifiedValueInfo, ToCss)]
 pub struct Opacity(Number);
 
 impl Parse for Opacity {