Bug 1518045 - Rustfmt has changed its default style. r=emilio
authorSimon Sapin <simon.sapin@exyr.org>
Fri, 14 Dec 2018 08:31:30 +0100
changeset 509773 c62ba89a005dc61b5bc627c6779dd780609eadab
parent 509772 4cfc198196e989cbda49033f03879d7f1b53fae7
child 509774 123ac731210fea368ff7bd4db93889e0faf390f2
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1518045, 22385
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 has changed its default style. r=emilio This cherry-picks the formatting parts of https://github.com/servo/servo/pull/22385.
servo/components/selectors/matching.rs
servo/components/selectors/parser.rs
servo/components/style/attr.rs
servo/components/style/bloom.rs
servo/components/style/build_gecko.rs
servo/components/style/context.rs
servo/components/style/custom_properties.rs
servo/components/style/dom.rs
servo/components/style/font_face.rs
servo/components/style/font_metrics.rs
servo/components/style/gecko/conversions.rs
servo/components/style/gecko/data.rs
servo/components/style/gecko/media_features.rs
servo/components/style/gecko/media_queries.rs
servo/components/style/gecko/selector_parser.rs
servo/components/style/gecko/values.rs
servo/components/style/gecko/wrapper.rs
servo/components/style/gecko_bindings/mod.rs
servo/components/style/gecko_bindings/sugar/ns_css_shadow_item.rs
servo/components/style/invalidation/element/element_wrapper.rs
servo/components/style/logical_geometry.rs
servo/components/style/matching.rs
servo/components/style/media_queries/media_feature.rs
servo/components/style/media_queries/media_feature_expression.rs
servo/components/style/media_queries/media_list.rs
servo/components/style/parallel.rs
servo/components/style/servo/media_queries.rs
servo/components/style/servo/selector_parser.rs
servo/components/style/shared_lock.rs
servo/components/style/sharing/mod.rs
servo/components/style/style_adjuster.rs
servo/components/style/stylesheets/font_feature_values_rule.rs
servo/components/style/stylesheets/keyframes_rule.rs
servo/components/style/stylesheets/rule_parser.rs
servo/components/style/stylesheets/supports_rule.rs
servo/components/style/stylesheets/viewport_rule.rs
servo/components/style/stylist.rs
servo/components/style/traversal.rs
servo/components/style/values/animated/mod.rs
servo/components/style/values/computed/border.rs
servo/components/style/values/computed/font.rs
servo/components/style/values/computed/length.rs
servo/components/style/values/generics/basic_shape.rs
servo/components/style/values/generics/font.rs
servo/components/style/values/generics/text.rs
servo/components/style/values/generics/transform.rs
servo/components/style/values/mod.rs
servo/components/style/values/specified/angle.rs
servo/components/style/values/specified/box.rs
servo/components/style/values/specified/calc.rs
servo/components/style/values/specified/counters.rs
servo/components/style/values/specified/font.rs
servo/components/style/values/specified/grid.rs
servo/components/style/values/specified/image.rs
servo/components/style/values/specified/length.rs
servo/components/style/values/specified/mod.rs
servo/components/style/values/specified/source_size_list.rs
servo/components/style/values/specified/text.rs
servo/components/style/values/specified/time.rs
servo/components/style_derive/cg.rs
servo/components/style_derive/parse.rs
servo/components/style_traits/lib.rs
servo/components/style_traits/viewport.rs
--- a/servo/components/selectors/matching.rs
+++ b/servo/components/selectors/matching.rs
@@ -256,20 +256,21 @@ where
     }
 
     debug_assert!(from_offset >= 1);
     debug_assert!(from_offset <= selector.len());
 
     let iter = selector.iter_from(selector.len() - from_offset);
     debug_assert!(
         iter.clone().next().is_some() ||
-            (from_offset != selector.len() && matches!(
-                selector.combinator_at_parse_order(from_offset),
-                Combinator::SlotAssignment | Combinator::PseudoElement
-            )),
+            (from_offset != selector.len() &&
+                matches!(
+                    selector.combinator_at_parse_order(from_offset),
+                    Combinator::SlotAssignment | Combinator::PseudoElement
+                )),
         "Got the math wrong: {:?} | {:?} | {} {}",
         selector,
         selector.iter_raw_match_order().as_slice(),
         from_offset,
         start_offset
     );
 
     for component in iter {
@@ -449,21 +450,19 @@ where
 
             element.containing_shadow_host()
         },
         Combinator::SlotAssignment => {
             debug_assert!(
                 context.current_host.is_some(),
                 "Should not be trying to match slotted rules in a non-shadow-tree context"
             );
-            debug_assert!(
-                element
-                    .assigned_slot()
-                    .map_or(true, |s| s.is_html_slot_element())
-            );
+            debug_assert!(element
+                .assigned_slot()
+                .map_or(true, |s| s.is_html_slot_element()));
             let scope = context.current_host?;
             let mut current_slot = element.assigned_slot()?;
             while current_slot.containing_shadow_host().unwrap().opaque() != scope {
                 current_slot = current_slot.assigned_slot()?;
             }
             Some(current_slot)
         },
         Combinator::PseudoElement => element.pseudo_element_originating_element(),
@@ -669,19 +668,19 @@ where
     F: FnMut(&E, ElementSelectorFlags),
 {
     debug_assert!(context.shared.is_nested() || !context.shared.in_negation());
 
     match *selector {
         Component::Combinator(_) => unreachable!(),
         Component::Slotted(ref selector) => {
             // <slots> are never flattened tree slottables.
-            !element.is_html_slot_element() && element.assigned_slot().is_some() && context
-                .shared
-                .nest(|context| {
+            !element.is_html_slot_element() &&
+                element.assigned_slot().is_some() &&
+                context.shared.nest(|context| {
                     matches_complex_selector(selector.iter(), element, context, flags_setter)
                 })
         },
         Component::PseudoElement(ref pseudo) => {
             element.match_pseudo_element(pseudo, context.shared)
         },
         Component::LocalName(ref local_name) => matches_local_name(element, local_name),
         Component::ExplicitUniversalType | Component::ExplicitAnyNamespace => true,
--- a/servo/components/selectors/parser.rs
+++ b/servo/components/selectors/parser.rs
@@ -444,27 +444,25 @@ where
                 ) {
                     return false;
                 }
             },
             AttributeInNoNamespace {
                 ref local_name,
                 never_matches,
                 ..
-            }
-                if !never_matches =>
-            {
+            } if !never_matches => {
                 if !visitor.visit_attribute_selector(
                     &NamespaceConstraint::Specific(&namespace_empty_string::<Impl>()),
                     local_name,
                     local_name,
                 ) {
                     return false;
                 }
-            }
+            },
             AttributeOther(ref attr_selector) if !attr_selector.never_matches => {
                 let empty_string;
                 let namespace = match attr_selector.namespace() {
                     Some(ns) => ns,
                     None => {
                         empty_string = crate::parser::namespace_empty_string::<Impl>();
                         NamespaceConstraint::Specific(&empty_string)
                     },
@@ -1361,17 +1359,17 @@ where
                 has_pseudo_element = has_pseudo;
                 slotted = slot;
             },
             None => {
                 return Err(input.new_custom_error(if builder.has_combinators() {
                     SelectorParseErrorKind::DanglingCombinator
                 } else {
                     SelectorParseErrorKind::EmptySelector
-                }))
+                }));
             },
         };
 
         if has_pseudo_element || slotted {
             break;
         }
 
         // Parse a combinator.
@@ -1629,17 +1627,17 @@ where
     let local_name;
 
     input.skip_whitespace();
 
     match parse_qualified_name(parser, input, /* in_attr_selector = */ true)? {
         OptionalQName::None(t) => {
             return Err(input.new_custom_error(
                 SelectorParseErrorKind::NoQualifiedNameInAttributeSelector(t),
-            ))
+            ));
         },
         OptionalQName::Some(_, None) => unreachable!(),
         OptionalQName::Some(ns, Some(ln)) => {
             local_name = ln;
             namespace = match ns {
                 QNamePrefix::ImplicitNoNamespace | QNamePrefix::ExplicitNoNamespace => None,
                 QNamePrefix::ExplicitNamespace(prefix, url) => {
                     Some(NamespaceConstraint::Specific((prefix, url)))
@@ -1686,17 +1684,17 @@ where
         Ok(&Token::PrefixMatch) => AttrSelectorOperator::Prefix,
         // [foo*=bar]
         Ok(&Token::SubstringMatch) => AttrSelectorOperator::Substring,
         // [foo$=bar]
         Ok(&Token::SuffixMatch) => AttrSelectorOperator::Suffix,
         Ok(t) => {
             return Err(location.new_custom_error(
                 SelectorParseErrorKind::UnexpectedTokenInAttributeSelector(t.clone()),
-            ))
+            ));
         },
     };
 
     let value = match input.expect_ident_or_string() {
         Ok(t) => t.clone(),
         Err(BasicParseError {
             kind: BasicParseErrorKind::UnexpectedToken(t),
             location,
@@ -1763,21 +1761,22 @@ enum AttributeFlags {
 }
 
 impl AttributeFlags {
     fn to_case_sensitivity(self, local_name: &str, have_namespace: bool) -> ParsedCaseSensitivity {
         match self {
             AttributeFlags::CaseSensitive => ParsedCaseSensitivity::ExplicitCaseSensitive,
             AttributeFlags::AsciiCaseInsensitive => ParsedCaseSensitivity::AsciiCaseInsensitive,
             AttributeFlags::CaseSensitivityDependsOnName => {
-                if !have_namespace && include!(concat!(
-                    env!("OUT_DIR"),
-                    "/ascii_case_insensitive_html_attributes.rs"
-                ))
-                .contains(local_name)
+                if !have_namespace &&
+                    include!(concat!(
+                        env!("OUT_DIR"),
+                        "/ascii_case_insensitive_html_attributes.rs"
+                    ))
+                    .contains(local_name)
                 {
                     ParsedCaseSensitivity::AsciiCaseInsensitiveIfInHtmlElementInHtmlDocument
                 } else {
                     ParsedCaseSensitivity::CaseSensitive
                 }
             },
         }
     }
@@ -1956,17 +1955,17 @@ 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())))
+                            .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/attr.rs
+++ b/servo/components/style/attr.rs
@@ -1,24 +1,24 @@
 /* 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/. */
 
 //! Parsed representations of [DOM attributes][attr].
 //!
 //! [attr]: https://dom.spec.whatwg.org/#interface-attr
 
-use app_units::Au;
 use crate::properties::PropertyDeclarationBlock;
 use crate::shared_lock::Locked;
 use crate::str::str_join;
 use crate::str::{read_exponent, read_fraction, HTML_SPACE_CHARACTERS};
 use crate::str::{read_numbers, split_commas, split_html_space_chars};
 use crate::values::specified::Length;
 use crate::{Atom, LocalName, Namespace, Prefix};
+use app_units::Au;
 use cssparser::{self, Color, RGBA};
 use euclid::num::Zero;
 use num_traits::ToPrimitive;
 use selectors::attr::AttrSelectorOperation;
 use servo_arc::Arc;
 use servo_url::ServoUrl;
 use std::str::FromStr;
 
--- a/servo/components/style/bloom.rs
+++ b/servo/components/style/bloom.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/. */
 
 //! The style bloom filter is used as an optimization when matching deep
 //! descendant selectors.
 
 #![deny(missing_docs)]
 
+use crate::dom::{SendElement, TElement};
 use atomic_refcell::{AtomicRefCell, AtomicRefMut};
-use crate::dom::{SendElement, TElement};
 use owning_ref::OwningHandle;
 use selectors::bloom::BloomFilter;
 use servo_arc::Arc;
 use smallvec::SmallVec;
 
 /// Bloom filters are large allocations, so we store them in thread-local storage
 /// such that they can be reused across style traversals. StyleBloom is responsible
 /// for ensuring that the bloom filter is zeroed when it is dropped.
--- a/servo/components/style/build_gecko.rs
+++ b/servo/components/style/build_gecko.rs
@@ -510,18 +510,17 @@ mod bindings {
             .handle_table_items("array-types", |builder, item| {
                 let cpp_type = item["cpp-type"].as_str().unwrap();
                 let rust_type = item["rust-type"].as_str().unwrap();
                 builder.raw_line(format!(
                     concat!(
                         "pub type nsTArrayBorrowed_{}<'a> = ",
                         "&'a mut ::gecko_bindings::structs::nsTArray<{}>;"
                     ),
-                    cpp_type,
-                    rust_type
+                    cpp_type, rust_type
                 ))
             })
             .handle_str_items("servo-immutable-borrow-types", |b, ty| b.borrowed_type(ty))
             // Right now the only immutable borrow types are ones which we import
             // from the |structs| module. As such, we don't need to create an opaque
             // type with zero_size_type. If we ever introduce immutable borrow types
             // which _do_ need to be opaque, we'll need a separate mode.
             .handle_str_items("servo-borrow-types", |b, ty| b.mutable_borrowed_type(ty))
--- a/servo/components/style/context.rs
+++ b/servo/components/style/context.rs
@@ -1,15 +1,14 @@
 /* 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/. */
 
 //! The context within which style is calculated.
 
-use app_units::Au;
 #[cfg(feature = "servo")]
 use crate::animation::Animation;
 use crate::bloom::StyleBloom;
 use crate::data::{EagerPseudoStyles, ElementData};
 #[cfg(feature = "servo")]
 use crate::dom::OpaqueNode;
 use crate::dom::{SendElement, TElement};
 use crate::font_metrics::FontMetricsProvider;
@@ -24,16 +23,17 @@ use crate::rule_tree::StrongRuleNode;
 use crate::selector_parser::{SnapshotMap, EAGER_PSEUDO_COUNT};
 use crate::shared_lock::StylesheetGuards;
 use crate::sharing::StyleSharingCache;
 use crate::stylist::Stylist;
 use crate::thread_state::{self, ThreadState};
 use crate::timer::Timer;
 use crate::traversal::DomTraversal;
 use crate::traversal_flags::TraversalFlags;
+use app_units::Au;
 #[cfg(feature = "servo")]
 use crossbeam_channel::Sender;
 use euclid::Size2D;
 use euclid::TypedScale;
 use fxhash::FxHashMap;
 #[cfg(feature = "servo")]
 use parking_lot::RwLock;
 use selectors::matching::ElementSelectorFlags;
--- a/servo/components/style/custom_properties.rs
+++ b/servo/components/style/custom_properties.rs
@@ -429,17 +429,17 @@ fn parse_declaration_value_block<'i, 't>
     let mut token_start = input.position();
     let mut token = match input.next_including_whitespace_and_comments() {
         // FIXME: remove clone() when borrows are non-lexical
         Ok(token) => token.clone(),
         Err(_) => {
             return Ok((
                 TokenSerializationType::nothing(),
                 TokenSerializationType::nothing(),
-            ))
+            ));
         },
     };
     let first_token_type = token.serialization_type();
     loop {
         macro_rules! nested {
             () => {
                 input.parse_nested_block(|input| {
                     parse_declaration_value_block(
--- a/servo/components/style/dom.rs
+++ b/servo/components/style/dom.rs
@@ -2,32 +2,32 @@
  * 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/. */
 
 //! Types and traits used to access the DOM from style calculation.
 
 #![allow(unsafe_code)]
 #![deny(missing_docs)]
 
-use atomic_refcell::{AtomicRef, AtomicRefCell, AtomicRefMut};
 use crate::applicable_declarations::ApplicableDeclarationBlock;
 #[cfg(feature = "gecko")]
 use crate::context::PostAnimationTasks;
 #[cfg(feature = "gecko")]
 use crate::context::UpdateAnimationsTasks;
 use crate::data::ElementData;
 use crate::element_state::ElementState;
 use crate::font_metrics::FontMetricsProvider;
 use crate::media_queries::Device;
 use crate::properties::{AnimationRules, ComputedValues, PropertyDeclarationBlock};
 use crate::selector_parser::{AttrValue, Lang, PseudoElement, SelectorImpl};
 use crate::shared_lock::Locked;
 use crate::stylist::CascadeData;
 use crate::traversal_flags::TraversalFlags;
 use crate::{Atom, LocalName, Namespace, WeakAtom};
+use atomic_refcell::{AtomicRef, AtomicRefCell, AtomicRefMut};
 use selectors::matching::{ElementSelectorFlags, QuirksMode, VisitedHandlingMode};
 use selectors::sink::Push;
 use selectors::Element as SelectorsElement;
 use servo_arc::{Arc, ArcBorrow};
 use std::fmt;
 use std::fmt::Debug;
 use std::hash::Hash;
 use std::ops::Deref;
@@ -37,20 +37,17 @@ use std::ops::Deref;
 /// performed on this node is to compare it to another opaque handle or to another
 /// OpaqueNode.
 ///
 /// Layout and Graphics use this to safely represent nodes for comparison purposes.
 /// Because the script task's GC does not trace layout, node data cannot be safely stored in layout
 /// data structures. Also, layout code tends to be faster when the DOM is not being accessed, for
 /// locality reasons. Using `OpaqueNode` enforces this invariant.
 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
-#[cfg_attr(
-    feature = "servo",
-    derive(MallocSizeOf, Deserialize, Serialize)
-)]
+#[cfg_attr(feature = "servo", derive(MallocSizeOf, Deserialize, Serialize))]
 pub struct OpaqueNode(pub usize);
 
 impl OpaqueNode {
     /// Returns the address of this node, for debugging purposes.
     #[inline]
     pub fn id(&self) -> usize {
         self.0
     }
--- a/servo/components/style/font_face.rs
+++ b/servo/components/style/font_face.rs
@@ -331,19 +331,20 @@ impl<'a> FontFace<'a> {
                 .iter()
                 .rev()
                 .filter(|source| {
                     if let Source::Url(ref url_source) = **source {
                         let hints = &url_source.format_hints;
                         // We support only opentype fonts and truetype is an alias for
                         // that format. Sources without format hints need to be
                         // downloaded in case we support them.
-                        hints.is_empty() || hints
-                            .iter()
-                            .any(|hint| hint == "truetype" || hint == "opentype" || hint == "woff")
+                        hints.is_empty() ||
+                            hints.iter().any(|hint| {
+                                hint == "truetype" || hint == "opentype" || hint == "woff"
+                            })
                     } else {
                         true
                     }
                 })
                 .cloned()
                 .collect(),
         )
     }
--- a/servo/components/style/font_metrics.rs
+++ b/servo/components/style/font_metrics.rs
@@ -1,22 +1,22 @@
 /* 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/. */
 
 //! Access to font metrics from the style system.
 
 #![deny(missing_docs)]
 
-use app_units::Au;
 use crate::context::SharedStyleContext;
 use crate::logical_geometry::WritingMode;
 use crate::media_queries::Device;
 use crate::properties::style_structs::Font;
 use crate::Atom;
+use app_units::Au;
 
 /// Represents the font metrics that style needs from a font to compute the
 /// value of certain CSS units like `ex`.
 #[derive(Clone, Debug, PartialEq)]
 pub struct FontMetrics {
     /// The x-height of the font.
     pub x_height: Au,
     /// The zero advance. This is usually writing mode dependent
--- a/servo/components/style/gecko/conversions.rs
+++ b/servo/components/style/gecko/conversions.rs
@@ -5,17 +5,16 @@
 //! This module contains conversion helpers between Servo and Gecko types
 //! Ideally, it would be in geckolib itself, but coherence
 //! forces us to keep the traits and implementations here
 //!
 //! FIXME(emilio): This file should generally just die.
 
 #![allow(unsafe_code)]
 
-use app_units::Au;
 use crate::gecko::values::GeckoStyleCoordConvertible;
 use crate::gecko_bindings::bindings;
 use crate::gecko_bindings::structs::RawGeckoGfxMatrix4x4;
 use crate::gecko_bindings::structs::{self, nsStyleCoord_CalcValue};
 use crate::gecko_bindings::structs::{nsStyleImage, nsresult, SheetType};
 use crate::gecko_bindings::sugar::ns_style_coord::{CoordData, CoordDataMut, CoordDataValue};
 use crate::stylesheets::{Origin, RulesMutateError};
 use crate::values::computed::image::LineDirection;
@@ -25,16 +24,17 @@ use crate::values::computed::{Angle, Cal
 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 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(),
             mPercent: other.percentage.map_or(0., |p| p.0),
--- a/servo/components/style/gecko/data.rs
+++ b/servo/components/style/gecko/data.rs
@@ -1,28 +1,28 @@
 /* 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/. */
 
 //! Data needed to style a Gecko document.
 
-use atomic_refcell::{AtomicRef, AtomicRefCell, AtomicRefMut};
 use crate::context::QuirksMode;
 use crate::dom::TElement;
 use crate::gecko_bindings::bindings::{self, RawServoStyleSet};
 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;
+use atomic_refcell::{AtomicRef, AtomicRefCell, AtomicRefMut};
 use malloc_size_of::MallocSizeOfOps;
 use servo_arc::Arc;
 use std::fmt;
 
 /// Little wrapper to a Gecko style sheet.
 #[derive(Eq, PartialEq)]
 pub struct GeckoStyleSheet(*const DomStyleSheet);
 
--- a/servo/components/style/gecko/media_features.rs
+++ b/servo/components/style/gecko/media_features.rs
@@ -1,24 +1,24 @@
 /* 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/. */
 
 //! Gecko's media feature list and evaluator.
 
-use app_units::Au;
 use crate::gecko_bindings::bindings;
 use crate::gecko_bindings::structs;
 use crate::media_queries::media_feature::{AllowsRanges, ParsingRequirements};
 use crate::media_queries::media_feature::{Evaluator, MediaFeatureDescription};
 use crate::media_queries::media_feature_expression::{AspectRatio, RangeOrOperator};
 use crate::media_queries::{Device, MediaType};
 use crate::values::computed::CSSPixelLength;
 use crate::values::computed::Resolution;
 use crate::Atom;
+use app_units::Au;
 use euclid::Size2D;
 
 fn viewport_size(device: &Device) -> Size2D<Au> {
     let pc = device.pres_context();
     if pc.mIsRootPaginatedDocument() != 0 {
         // We want the page size, including unprintable areas and margins.
         // FIXME(emilio, bug 1414600): Not quite!
         let area = &pc.mPageSize;
--- a/servo/components/style/gecko/media_queries.rs
+++ b/servo/components/style/gecko/media_queries.rs
@@ -1,26 +1,26 @@
 /* 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/. */
 
 //! Gecko's media-query device and expression representation.
 
-use app_units::Au;
-use app_units::AU_PER_PX;
 use crate::custom_properties::CssEnvironment;
 use crate::gecko::values::{convert_nscolor_to_rgba, convert_rgba_to_nscolor};
 use crate::gecko_bindings::bindings;
 use crate::gecko_bindings::structs;
 use crate::gecko_bindings::structs::{nsPresContext, RawGeckoPresContextBorrowed};
 use crate::media_queries::MediaType;
 use crate::properties::ComputedValues;
 use crate::string_cache::Atom;
 use crate::values::computed::font::FontSize;
 use crate::values::{CustomIdent, KeyframesName};
+use app_units::Au;
+use app_units::AU_PER_PX;
 use cssparser::RGBA;
 use euclid::Size2D;
 use euclid::TypedScale;
 use servo_arc::Arc;
 use std::fmt;
 use std::sync::atomic::{AtomicBool, AtomicIsize, AtomicUsize, Ordering};
 use style_traits::viewport::ViewportConstraints;
 use style_traits::{CSSPixel, DevicePixel};
--- a/servo/components/style/gecko/selector_parser.rs
+++ b/servo/components/style/gecko/selector_parser.rs
@@ -225,43 +225,44 @@ impl NonTSPseudoClass {
             NonTSPseudoClass::MozWindowInactive => DocumentState::NS_DOCUMENT_STATE_WINDOW_INACTIVE,
             _ => DocumentState::empty(),
         }
     }
 
     /// Returns true if the given pseudoclass should trigger style sharing cache
     /// 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(_) |
-                  // :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
-                  // states for elements and candidates.
-                  NonTSPseudoClass::Dir(_) |
-                  // :-moz-is-html only depends on the state of the document and
-                  // the namespace of the element; the former is invariant
-                  // across all the elements involved and the latter is already
-                  // checked for by our caching precondtions.
-                  NonTSPseudoClass::MozIsHTML |
-                  // :-moz-placeholder is parsed but never matches.
-                  NonTSPseudoClass::MozPlaceholder |
-                  // :-moz-locale-dir and :-moz-window-inactive depend only on
-                  // the state of the document, which is invariant across all
-                  // the elements involved in a given style cache.
-                  NonTSPseudoClass::MozLocaleDir(_) |
-                  NonTSPseudoClass::MozWindowInactive |
-                  // Similar for the document themes.
-                  NonTSPseudoClass::MozLWTheme |
-                  NonTSPseudoClass::MozLWThemeBrightText |
-                  NonTSPseudoClass::MozLWThemeDarkText
-        )
+        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(_) |
+                      // :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
+                      // states for elements and candidates.
+                      NonTSPseudoClass::Dir(_) |
+                      // :-moz-is-html only depends on the state of the document and
+                      // the namespace of the element; the former is invariant
+                      // across all the elements involved and the latter is already
+                      // checked for by our caching precondtions.
+                      NonTSPseudoClass::MozIsHTML |
+                      // :-moz-placeholder is parsed but never matches.
+                      NonTSPseudoClass::MozPlaceholder |
+                      // :-moz-locale-dir and :-moz-window-inactive depend only on
+                      // the state of the document, which is invariant across all
+                      // the elements involved in a given style cache.
+                      NonTSPseudoClass::MozLocaleDir(_) |
+                      NonTSPseudoClass::MozWindowInactive |
+                      // Similar for the document themes.
+                      NonTSPseudoClass::MozLWTheme |
+                      NonTSPseudoClass::MozLWThemeBrightText |
+                      NonTSPseudoClass::MozLWThemeDarkText
+            )
     }
 
     /// Returns true if the evaluation of the pseudo-class depends on the
     /// element's attributes.
     pub fn is_attr_based(&self) -> bool {
         matches!(
             *self,
             NonTSPseudoClass::MozTableBorderNonzero |
--- a/servo/components/style/gecko/values.rs
+++ b/servo/components/style/gecko/values.rs
@@ -1,17 +1,16 @@
 /* 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/. */
 
 #![allow(unsafe_code)]
 
 //! Different kind of helpers to interact with Gecko values.
 
-use app_units::Au;
 use crate::counter_style::{Symbol, Symbols};
 use crate::gecko_bindings::structs::{self, nsStyleCoord, CounterStylePtr};
 use crate::gecko_bindings::structs::{StyleGridTrackBreadth, StyleShapeRadius};
 use crate::gecko_bindings::sugar::ns_style_coord::{CoordData, CoordDataMut, CoordDataValue};
 use crate::media_queries::Device;
 use crate::values::computed::basic_shape::ShapeRadius as ComputedShapeRadius;
 use crate::values::computed::FlexBasis as ComputedFlexBasis;
 use crate::values::computed::{Angle, ExtremumLength, Length, LengthOrPercentage};
@@ -22,16 +21,17 @@ use crate::values::generics::basic_shape
 use crate::values::generics::box_::Perspective;
 use crate::values::generics::flex::FlexBasis;
 use crate::values::generics::gecko::ScrollSnapPoint;
 use crate::values::generics::grid::{TrackBreadth, TrackKeyword};
 use crate::values::generics::length::{MaxLength, MozLength};
 use crate::values::generics::{CounterStyleOrNone, NonNegative};
 use crate::values::{Auto, Either, None_, Normal};
 use crate::Atom;
+use app_units::Au;
 use cssparser::RGBA;
 use nsstring::{nsACString, nsCStr};
 use std::cmp::max;
 
 /// A trait that defines an interface to convert from and to `nsStyleCoord`s.
 ///
 /// TODO(emilio): Almost everything that is in this file should be somehow
 /// switched to cbindgen.
--- a/servo/components/style/gecko/wrapper.rs
+++ b/servo/components/style/gecko/wrapper.rs
@@ -9,18 +9,16 @@
 //!
 //! This really follows the Servo pattern in
 //! `components/script/layout_wrapper.rs`.
 //!
 //! This theoretically should live in its own crate, but now it lives in the
 //! style system it's kind of pointless in the Stylo case, and only Servo forces
 //! the separation between the style system implementation and everything else.
 
-use app_units::Au;
-use atomic_refcell::{AtomicRefCell, AtomicRefMut};
 use crate::applicable_declarations::ApplicableDeclarationBlock;
 use crate::author_styles::AuthorStyles;
 use crate::context::{PostAnimationTasks, QuirksMode, SharedStyleContext, UpdateAnimationsTasks};
 use crate::data::ElementData;
 use crate::dom::{LayoutIterator, NodeInfo, OpaqueNode, TDocument, TElement, TNode, TShadowRoot};
 use crate::element_state::{DocumentState, ElementState};
 use crate::font_metrics::{FontMetrics, FontMetricsProvider, FontMetricsQueryResult};
 use crate::gecko::data::GeckoStyleSheet;
@@ -67,16 +65,18 @@ use crate::properties::style_structs::Fo
 use crate::properties::{ComputedValues, LonghandId};
 use crate::properties::{Importance, PropertyDeclaration, PropertyDeclarationBlock};
 use crate::rule_tree::CascadeLevel as ServoCascadeLevel;
 use crate::selector_parser::{AttrValue, HorizontalDirection, Lang};
 use crate::shared_lock::Locked;
 use crate::string_cache::{Atom, Namespace, WeakAtom, WeakNamespace};
 use crate::stylist::CascadeData;
 use crate::CaseSensitivityExt;
+use app_units::Au;
+use atomic_refcell::{AtomicRefCell, AtomicRefMut};
 use selectors::attr::{AttrSelectorOperation, AttrSelectorOperator};
 use selectors::attr::{CaseSensitivity, NamespaceConstraint};
 use selectors::matching::VisitedHandlingMode;
 use selectors::matching::{ElementSelectorFlags, MatchingContext};
 use selectors::sink::Push;
 use selectors::{Element, OpaqueElement};
 use servo_arc::{Arc, ArcBorrow, RawOffsetArc};
 use std::cell::RefCell;
@@ -926,23 +926,24 @@ impl<'le> GeckoElement<'le> {
             return ***existing != after_value;
         }
 
         let from = AnimationValue::from_computed_values(longhand_id, before_change_style);
         let to = AnimationValue::from_computed_values(longhand_id, after_change_style);
 
         debug_assert_eq!(to.is_some(), from.is_some());
 
-        combined_duration > 0.0f32 && from != to && from
-            .unwrap()
-            .animate(
-                to.as_ref().unwrap(),
-                Procedure::Interpolate { progress: 0.5 },
-            )
-            .is_ok()
+        combined_duration > 0.0f32 &&
+            from != to &&
+            from.unwrap()
+                .animate(
+                    to.as_ref().unwrap(),
+                    Procedure::Interpolate { progress: 0.5 },
+                )
+                .is_ok()
     }
 }
 
 /// Converts flags from the layout used by rust-selectors to the layout used
 /// by Gecko. We could align these and then do this without conditionals, but
 /// it's probably not worth the trouble.
 fn selector_flags_to_node_flags(flags: ElementSelectorFlags) -> u32 {
     use crate::gecko_bindings::structs::*;
@@ -1236,20 +1237,21 @@ 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
+        self.as_node().owner_doc().0 as *const structs::Document ==
+            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) };
@@ -1856,19 +1858,18 @@ impl<'le> TElement for GeckoElement<'le>
                 ));
             }
 
             let active = self
                 .state()
                 .intersects(NonTSPseudoClass::Active.state_flag());
             if active {
                 let declarations = unsafe { Gecko_GetActiveLinkAttrDeclarationBlock(self.0) };
-                let declarations: Option<
-                    &RawOffsetArc<Locked<PropertyDeclarationBlock>>,
-                > = declarations.and_then(|s| s.as_arc_opt());
+                let declarations: Option<&RawOffsetArc<Locked<PropertyDeclarationBlock>>> =
+                    declarations.and_then(|s| s.as_arc_opt());
                 if let Some(decl) = declarations {
                     hints.push(ApplicableDeclarationBlock::from_declarations(
                         decl.clone_arc(),
                         ServoCascadeLevel::PresHints,
                     ));
                 }
             }
         }
@@ -2073,21 +2074,20 @@ impl<'le> ::selectors::Element for Gecko
         {
             return false;
         }
 
         if !self.as_node().is_in_document() {
             return false;
         }
 
-        debug_assert!(
-            self.as_node()
-                .parent_node()
-                .map_or(false, |p| p.is_document())
-        );
+        debug_assert!(self
+            .as_node()
+            .parent_node()
+            .map_or(false, |p| p.is_document()));
         unsafe { bindings::Gecko_IsRootElement(self.0) }
     }
 
     fn is_empty(&self) -> bool {
         !self
             .as_node()
             .dom_children()
             .any(|child| unsafe { Gecko_IsSignificantChild(child.0, true) })
--- a/servo/components/style/gecko_bindings/mod.rs
+++ b/servo/components/style/gecko_bindings/mod.rs
@@ -1,20 +1,15 @@
 /* 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/. */
 
 //! Gecko's C++ bindings, along with some rust helpers to ease its use.
 
-#[allow(
-    dead_code,
-    improper_ctypes,
-    non_camel_case_types,
-    missing_docs
-)]
+#[allow(dead_code, improper_ctypes, non_camel_case_types, missing_docs)]
 pub mod bindings {
     include!(concat!(env!("OUT_DIR"), "/gecko/bindings.rs"));
 }
 
 // FIXME: We allow `improper_ctypes` (for now), because the lint doesn't allow
 // foreign structs to have `PhantomData`. We should remove this once the lint
 // ignores this case.
 
--- a/servo/components/style/gecko_bindings/sugar/ns_css_shadow_item.rs
+++ b/servo/components/style/gecko_bindings/sugar/ns_css_shadow_item.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 `nsCSSShadowItem`.
 
-use app_units::Au;
 use crate::gecko_bindings::structs::nsCSSShadowItem;
 use crate::values::computed::effects::{BoxShadow, SimpleShadow};
+use app_units::Au;
 
 impl nsCSSShadowItem {
     /// Sets this item from the given box shadow.
     #[inline]
     pub fn set_from_box_shadow(&mut self, shadow: BoxShadow) {
         self.set_from_simple_shadow(shadow.base);
         self.mSpread = shadow.spread.to_i32_au();
         self.mInset = shadow.inset;
--- a/servo/components/style/invalidation/element/element_wrapper.rs
+++ b/servo/components/style/invalidation/element/element_wrapper.rs
@@ -203,20 +203,20 @@ where
             },
 
             // For :link and :visited, we don't actually want to test the
             // element state directly.
             //
             // Instead, we use the `visited_handling` to determine if they
             // match.
             NonTSPseudoClass::Link => {
-                return self.is_link() && context.visited_handling().matches_unvisited()
+                return self.is_link() && context.visited_handling().matches_unvisited();
             },
             NonTSPseudoClass::Visited => {
-                return self.is_link() && context.visited_handling().matches_visited()
+                return self.is_link() && context.visited_handling().matches_visited();
             },
 
             #[cfg(feature = "gecko")]
             NonTSPseudoClass::MozTableBorderNonzero => {
                 if let Some(snapshot) = self.snapshot() {
                     if snapshot.has_other_pseudo_class_state() {
                         return snapshot.mIsTableBorderNonzero();
                     }
--- a/servo/components/style/logical_geometry.rs
+++ b/servo/components/style/logical_geometry.rs
@@ -1216,21 +1216,22 @@ impl<T: Copy + Add<T, Output = T> + Sub<
         LogicalRect {
             start: self.start + offset,
             ..*self
         }
     }
 
     pub fn translate(&self, offset: &LogicalPoint<T>) -> LogicalRect<T> {
         LogicalRect {
-            start: self.start + LogicalSize {
-                inline: offset.i,
-                block: offset.b,
-                debug_writing_mode: offset.debug_writing_mode,
-            },
+            start: self.start +
+                LogicalSize {
+                    inline: offset.i,
+                    block: offset.b,
+                    debug_writing_mode: offset.debug_writing_mode,
+                },
             size: self.size,
             debug_writing_mode: self.debug_writing_mode,
         }
     }
 }
 
 impl<T: Copy + Ord + Add<T, Output = T> + Sub<T, Output = T>> LogicalRect<T> {
     #[inline]
--- a/servo/components/style/matching.rs
+++ b/servo/components/style/matching.rs
@@ -464,21 +464,19 @@ trait PrivateMatchMethods: TElement {
         &self,
         shared_context: &SharedStyleContext,
         damage: &mut RestyleDamage,
         old_values: &ComputedValues,
         new_values: &ComputedValues,
         pseudo: Option<&PseudoElement>,
     ) -> ChildCascadeRequirement {
         debug!("accumulate_damage_for: {:?}", self);
-        debug_assert!(
-            !shared_context
-                .traversal_flags
-                .contains(TraversalFlags::Forgetful)
-        );
+        debug_assert!(!shared_context
+            .traversal_flags
+            .contains(TraversalFlags::Forgetful));
 
         let difference = self.compute_style_difference(old_values, new_values, pseudo);
 
         *damage |= difference.damage;
 
         debug!(" > style difference: {:?}", difference);
 
         // We need to cascade the children in order to ensure the correct
--- a/servo/components/style/media_queries/media_feature.rs
+++ b/servo/components/style/media_queries/media_feature.rs
@@ -25,19 +25,20 @@ type MediaFeatureEvaluator<T> = fn(
 
 /// Serializes a given discriminant.
 ///
 /// FIXME(emilio): we could prevent this allocation if the ToCss code would
 /// generate a method for keywords to get the static string or something.
 pub type KeywordSerializer = fn(KeywordDiscriminant) -> String;
 
 /// Parses a given identifier.
-pub type KeywordParser =
-    for<'a, 'i, 't> fn(context: &'a ParserContext, input: &'a mut Parser<'i, 't>)
-        -> Result<KeywordDiscriminant, ParseError<'i>>;
+pub type KeywordParser = for<'a, 'i, 't> fn(
+    context: &'a ParserContext,
+    input: &'a mut Parser<'i, 't>,
+) -> Result<KeywordDiscriminant, ParseError<'i>>;
 
 /// An evaluator for a given media feature.
 ///
 /// This determines the kind of values that get parsed, too.
 #[allow(missing_docs)]
 pub enum Evaluator {
     Length(MediaFeatureEvaluator<CSSPixelLength>),
     Integer(MediaFeatureEvaluator<u32>),
--- a/servo/components/style/media_queries/media_feature_expression.rs
+++ b/servo/components/style/media_queries/media_feature_expression.rs
@@ -129,20 +129,21 @@ impl RangeOrOperator {
 
         let range_or_op = match range_or_op {
             Some(r) => r,
             None => return cmp == Ordering::Equal,
         };
 
         match range_or_op {
             RangeOrOperator::Range(range) => {
-                cmp == Ordering::Equal || match range {
-                    Range::Min => cmp == Ordering::Greater,
-                    Range::Max => cmp == Ordering::Less,
-                }
+                cmp == Ordering::Equal ||
+                    match range {
+                        Range::Min => cmp == Ordering::Greater,
+                        Range::Max => cmp == Ordering::Less,
+                    }
             },
             RangeOrOperator::Operator(op) => match op {
                 Operator::Equal => cmp == Ordering::Equal,
                 Operator::GreaterThan => cmp == Ordering::Greater,
                 Operator::GreaterThanEqual => cmp == Ordering::Equal || cmp == Ordering::Greater,
                 Operator::LessThan => cmp == Ordering::Less,
                 Operator::LessThanEqual => cmp == Ordering::Equal || cmp == Ordering::Less,
             },
@@ -339,17 +340,17 @@ impl MediaFeatureExpression {
                 Ok((i, f, r)) => {
                     feature_index = i;
                     feature = f;
                     range = r;
                 },
                 Err(()) => {
                     return Err(location.new_custom_error(
                         StyleParseErrorKind::MediaQueryExpectedFeatureName(ident.clone()),
-                    ))
+                    ));
                 },
             }
 
             if !(feature.requirements & !requirements).is_empty() {
                 return Err(location.new_custom_error(
                     StyleParseErrorKind::MediaQueryExpectedFeatureName(ident.clone()),
                 ));
             }
--- a/servo/components/style/media_queries/media_list.rs
+++ b/servo/components/style/media_queries/media_list.rs
@@ -69,31 +69,32 @@ impl MediaList {
             media_queries: vec![],
         }
     }
 
     /// Evaluate a whole `MediaList` against `Device`.
     pub fn evaluate(&self, device: &Device, quirks_mode: QuirksMode) -> bool {
         // Check if it is an empty media query list or any queries match.
         // https://drafts.csswg.org/mediaqueries-4/#mq-list
-        self.media_queries.is_empty() || self.media_queries.iter().any(|mq| {
-            let media_match = mq.media_type.matches(device.media_type());
+        self.media_queries.is_empty() ||
+            self.media_queries.iter().any(|mq| {
+                let media_match = mq.media_type.matches(device.media_type());
 
-            // Check if the media condition match.
-            let query_match = media_match && mq
-                .condition
-                .as_ref()
-                .map_or(true, |c| c.matches(device, quirks_mode));
+                // Check if the media condition match.
+                let query_match = media_match &&
+                    mq.condition
+                        .as_ref()
+                        .map_or(true, |c| c.matches(device, quirks_mode));
 
-            // Apply the logical NOT qualifier to the result
-            match mq.qualifier {
-                Some(Qualifier::Not) => !query_match,
-                _ => query_match,
-            }
-        })
+                // Apply the logical NOT qualifier to the result
+                match mq.qualifier {
+                    Some(Qualifier::Not) => !query_match,
+                    _ => query_match,
+                }
+            })
     }
 
     /// Whether this `MediaList` contains no media queries.
     pub fn is_empty(&self) -> bool {
         self.media_queries.is_empty()
     }
 
     /// Append a new media query item to the media list.
--- a/servo/components/style/parallel.rs
+++ b/servo/components/style/parallel.rs
@@ -17,21 +17,21 @@
 //! share them with other threads. In the parallel traversal, we explicitly
 //! invoke |unsafe { SendNode::new(n) }| to put nodes in containers that may
 //! be sent to other threads. This occurs in only a handful of places and is
 //! easy to grep for. At the time of this writing, there is no other unsafe
 //! code in the parallel traversal.
 
 #![deny(missing_docs)]
 
-use arrayvec::ArrayVec;
 use crate::context::{StyleContext, ThreadLocalStyleContext};
 use crate::dom::{OpaqueNode, SendNode, TElement};
 use crate::scoped_tls::ScopedTLS;
 use crate::traversal::{DomTraversal, PerLevelTraversalData};
+use arrayvec::ArrayVec;
 use itertools::Itertools;
 use rayon;
 use smallvec::SmallVec;
 
 /// The minimum stack size for a thread in the styling pool, in kilobytes.
 pub const STYLE_THREAD_STACK_SIZE_KB: usize = 256;
 
 /// The stack margin. If we get this deep in the stack, we will skip recursive
--- a/servo/components/style/servo/media_queries.rs
+++ b/servo/components/style/servo/media_queries.rs
@@ -1,24 +1,24 @@
 /* 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/. */
 
 //! Servo's media-query device and expression representation.
 
-use app_units::Au;
 use crate::custom_properties::CssEnvironment;
 use crate::media_queries::media_feature::{AllowsRanges, ParsingRequirements};
 use crate::media_queries::media_feature::{Evaluator, MediaFeatureDescription};
 use crate::media_queries::media_feature_expression::RangeOrOperator;
 use crate::media_queries::MediaType;
 use crate::properties::ComputedValues;
 use crate::values::computed::font::FontSize;
 use crate::values::computed::CSSPixelLength;
 use crate::values::KeyframesName;
+use app_units::Au;
 use cssparser::RGBA;
 use euclid::{Size2D, TypedScale, TypedSize2D};
 use std::sync::atomic::{AtomicBool, AtomicIsize, Ordering};
 use style_traits::viewport::ViewportConstraints;
 use style_traits::{CSSPixel, DevicePixel};
 
 /// A device is a structure that represents the current media a given document
 /// is displayed in.
--- a/servo/components/style/servo/selector_parser.rs
+++ b/servo/components/style/servo/selector_parser.rs
@@ -452,17 +452,17 @@ impl<'a, 'i> ::selectors::Parser<'i> for
     }
 
     fn parse_non_ts_functional_pseudo_class<'t>(
         &self,
         name: CowRcStr<'i>,
         parser: &mut CssParser<'i, 't>,
     ) -> Result<NonTSPseudoClass, ParseError<'i>> {
         use self::NonTSPseudoClass::*;
-        let pseudo_class = match_ignore_ascii_case!{ &name,
+        let pseudo_class = match_ignore_ascii_case! { &name,
             "lang" => {
                 Lang(parser.expect_ident_or_string()?.as_ref().into())
             }
             "-servo-case-sensitive-type-attr" => {
                 if !self.in_user_agent_stylesheet() {
                     return Err(parser.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(name.clone())));
                 }
                 ServoCaseSensitiveTypeAttr(Atom::from(parser.expect_ident()?.as_ref()))
--- a/servo/components/style/shared_lock.rs
+++ b/servo/components/style/shared_lock.rs
@@ -1,18 +1,18 @@
 /* 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/. */
 
 //! Different objects protected by the same lock
 
+use crate::str::{CssString, CssStringWriter};
+use crate::stylesheets::Origin;
 #[cfg(feature = "gecko")]
 use atomic_refcell::{AtomicRef, AtomicRefCell, AtomicRefMut};
-use crate::str::{CssString, CssStringWriter};
-use crate::stylesheets::Origin;
 #[cfg(feature = "servo")]
 use parking_lot::RwLock;
 use servo_arc::Arc;
 use std::cell::UnsafeCell;
 use std::fmt;
 #[cfg(feature = "servo")]
 use std::mem;
 #[cfg(feature = "gecko")]
--- a/servo/components/style/sharing/mod.rs
+++ b/servo/components/style/sharing/mod.rs
@@ -59,27 +59,27 @@
 //! the up-front checks but would have different matching results for the
 //! selector in question.  In this case, "descendants" includes pseudo-elements,
 //! so there is a single selector map of revalidation selectors that includes
 //! both selectors targeting elements and selectors targeting pseudo-element
 //! originating elements.  We ensure that the pseudo-element parts of all these
 //! selectors are effectively stripped off, so that matching them all against
 //! elements makes sense.
 
-use atomic_refcell::{AtomicRefCell, AtomicRefMut};
 use crate::applicable_declarations::ApplicableDeclarationBlock;
 use crate::bloom::StyleBloom;
 use crate::context::{SelectorFlagsMap, SharedStyleContext, StyleContext};
 use crate::dom::{SendElement, TElement};
 use crate::matching::MatchMethods;
 use crate::properties::ComputedValues;
 use crate::rule_tree::StrongRuleNode;
 use crate::style_resolver::{PrimaryStyle, ResolvedElementStyles};
 use crate::stylist::Stylist;
 use crate::Atom;
+use atomic_refcell::{AtomicRefCell, AtomicRefMut};
 use owning_ref::OwningHandle;
 use selectors::matching::{ElementSelectorFlags, VisitedHandlingMode};
 use selectors::NthIndexCache;
 use servo_arc::Arc;
 use smallbitvec::SmallBitVec;
 use smallvec::SmallVec;
 use std::marker::PhantomData;
 use std::mem;
--- a/servo/components/style/style_adjuster.rs
+++ b/servo/components/style/style_adjuster.rs
@@ -1,23 +1,23 @@
 /* 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/. */
 
 //! A struct to encapsulate all the style fixups and flags propagations
 //! a computed style needs in order for it to adhere to the CSS spec.
 
-use app_units::Au;
 use crate::dom::TElement;
 use crate::properties::computed_value_flags::ComputedValueFlags;
 use crate::properties::longhands::display::computed_value::T as Display;
 use crate::properties::longhands::float::computed_value::T as Float;
 use crate::properties::longhands::overflow_x::computed_value::T as Overflow;
 use crate::properties::longhands::position::computed_value::T as Position;
 use crate::properties::{self, ComputedValues, StyleBuilder};
+use app_units::Au;
 
 /// A struct that implements all the adjustment methods.
 ///
 /// NOTE(emilio): If new adjustments are introduced that depend on reset
 /// properties of the parent, you may need tweaking the
 /// `ChildCascadeRequirement` code in `matching.rs`.
 ///
 /// NOTE(emilio): Also, if new adjustments are introduced that break the
@@ -185,22 +185,20 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
                     blockify = $if_what;
                 }
             };
         }
 
         let is_root = self.style.pseudo.is_none() && element.map_or(false, |e| e.is_root());
         blockify_if!(is_root);
         if !self.skip_item_display_fixup(element) {
-            blockify_if!(
-                layout_parent_style
-                    .get_box()
-                    .clone_display()
-                    .is_item_container()
-            );
+            blockify_if!(layout_parent_style
+                .get_box()
+                .clone_display()
+                .is_item_container());
         }
 
         let is_item_or_root = blockify;
 
         blockify_if!(self.style.floated());
         blockify_if!(self.style.out_of_flow_positioned());
 
         if !blockify {
@@ -215,21 +213,22 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
                 .set_adjusted_display(blockified_display, is_item_or_root);
         }
     }
 
     /// Compute a few common flags for both text and element's style.
     pub fn set_bits(&mut self) {
         let display = self.style.get_box().clone_display();
 
-        if !display.is_contents() && !self
-            .style
-            .get_text()
-            .clone_text_decoration_line()
-            .is_empty()
+        if !display.is_contents() &&
+            !self
+                .style
+                .get_text()
+                .clone_text_decoration_line()
+                .is_empty()
         {
             self.style
                 .flags
                 .insert(ComputedValueFlags::HAS_TEXT_DECORATION_LINES);
         }
 
         if self.style.is_pseudo_element() {
             self.style
@@ -294,20 +293,20 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
     /// additionally it applies it if it is in any ruby box.
     ///
     /// This is necessary because its parent may not itself have the flag set
     /// (e.g. ruby or ruby containers), thus we may not inherit the flag from
     /// them.
     #[cfg(feature = "gecko")]
     fn adjust_for_text_in_ruby(&mut self) {
         let parent_display = self.style.get_parent_box().clone_display();
-        if parent_display.is_ruby_type() || self
-            .style
-            .get_parent_flags()
-            .contains(ComputedValueFlags::SHOULD_SUPPRESS_LINEBREAK)
+        if parent_display.is_ruby_type() ||
+            self.style
+                .get_parent_flags()
+                .contains(ComputedValueFlags::SHOULD_SUPPRESS_LINEBREAK)
         {
             self.style
                 .flags
                 .insert(ComputedValueFlags::SHOULD_SUPPRESS_LINEBREAK);
         }
     }
 
     /// <https://drafts.csswg.org/css-writing-modes-3/#block-flow:>
--- a/servo/components/style/stylesheets/font_feature_values_rule.rs
+++ b/servo/components/style/stylesheets/font_feature_values_rule.rs
@@ -65,21 +65,17 @@ impl Parse for SingleValue {
     fn parse<'i, 't>(
         _context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<SingleValue, ParseError<'i>> {
         let location = input.current_source_location();
         match *input.next()? {
             Token::Number {
                 int_value: Some(v), ..
-            }
-                if v >= 0 =>
-            {
-                Ok(SingleValue(v as u32))
-            },
+            } if v >= 0 => Ok(SingleValue(v as u32)),
             ref t => Err(location.new_unexpected_token_error(t.clone())),
         }
     }
 }
 
 #[cfg(feature = "gecko")]
 impl ToGeckoFontFeatureValues for SingleValue {
     fn to_gecko_font_feature_values(&self, array: &mut nsTArray<u32>) {
@@ -98,32 +94,24 @@ impl Parse for PairValues {
     fn parse<'i, 't>(
         _context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<PairValues, ParseError<'i>> {
         let location = input.current_source_location();
         let first = match *input.next()? {
             Token::Number {
                 int_value: Some(a), ..
-            }
-                if a >= 0 =>
-            {
-                a as u32
-            },
+            } if a >= 0 => a as u32,
             ref t => return Err(location.new_unexpected_token_error(t.clone())),
         };
         let location = input.current_source_location();
         match input.next() {
             Ok(&Token::Number {
                 int_value: Some(b), ..
-            })
-                if b >= 0 =>
-            {
-                Ok(PairValues(first, Some(b as u32)))
-            },
+            }) if b >= 0 => Ok(PairValues(first, Some(b as u32))),
             // It can't be anything other than number.
             Ok(t) => Err(location.new_unexpected_token_error(t.clone())),
             // It can be just one value.
             Err(_) => Ok(PairValues(first, None)),
         }
     }
 }
 
@@ -152,21 +140,19 @@ impl Parse for VectorValues {
         input: &mut Parser<'i, 't>,
     ) -> Result<VectorValues, ParseError<'i>> {
         let mut vec = vec![];
         loop {
             let location = input.current_source_location();
             match input.next() {
                 Ok(&Token::Number {
                     int_value: Some(a), ..
-                })
-                    if a >= 0 =>
-                {
+                }) if a >= 0 => {
                     vec.push(a as u32);
-                }
+                },
                 // It can't be anything other than number.
                 Ok(t) => return Err(location.new_unexpected_token_error(t.clone())),
                 Err(_) => break,
             }
         }
 
         if vec.len() == 0 {
             return Err(input.new_error(BasicParseErrorKind::EndOfInput));
--- a/servo/components/style/stylesheets/keyframes_rule.rs
+++ b/servo/components/style/stylesheets/keyframes_rule.rs
@@ -136,21 +136,17 @@ impl KeyframePercentage {
                 Ok(KeyframePercentage::new(0.))
             },
             Token::Ident(ref identifier) if identifier.as_ref().eq_ignore_ascii_case("to") => {
                 Ok(KeyframePercentage::new(1.))
             },
             Token::Percentage {
                 unit_value: percentage,
                 ..
-            }
-                if percentage >= 0. && percentage <= 1. =>
-            {
-                Ok(KeyframePercentage::new(percentage))
-            },
+            } if percentage >= 0. && percentage <= 1. => Ok(KeyframePercentage::new(percentage)),
             _ => Err(input.new_unexpected_token_error(token)),
         }
     }
 }
 
 /// A keyframes selector is a list of percentages or from/to symbols, which are
 /// converted at parse time to percentages.
 #[css(comma)]
@@ -595,17 +591,17 @@ impl<'a, 'b, 'i> DeclarationParser<'i> f
     fn parse_value<'t>(
         &mut self,
         name: CowRcStr<'i>,
         input: &mut Parser<'i, 't>,
     ) -> Result<(), ParseError<'i>> {
         let id = match PropertyId::parse(&name, self.context) {
             Ok(id) => id,
             Err(()) => {
-                return Err(input.new_custom_error(StyleParseErrorKind::UnknownProperty(name)))
+                return Err(input.new_custom_error(StyleParseErrorKind::UnknownProperty(name)));
             },
         };
 
         // TODO(emilio): Shouldn't this use parse_entirely?
         PropertyDeclaration::parse_into(self.declarations, id, self.context, input)?;
 
         // In case there is still unparsed text in the declaration, we should
         // roll back.
--- a/servo/components/style/stylesheets/rule_parser.rs
+++ b/servo/components/style/stylesheets/rule_parser.rs
@@ -102,19 +102,20 @@ impl<'b> TopLevelRuleParser<'b> {
         if new_state > next_rule_state {
             self.dom_error = Some(RulesMutateError::HierarchyRequest);
             return false;
         }
 
         // If there's anything that isn't a namespace rule (or import rule, but
         // we checked that already at the beginning), reject with a
         // StateError.
-        if new_state == State::Namespaces && ctx.rule_list[ctx.index..]
-            .iter()
-            .any(|r| !matches!(*r, CssRule::Namespace(..)))
+        if new_state == State::Namespaces &&
+            ctx.rule_list[ctx.index..]
+                .iter()
+                .any(|r| !matches!(*r, CssRule::Namespace(..)))
         {
             self.dom_error = Some(RulesMutateError::InvalidState);
             return false;
         }
 
         true
     }
 }
--- a/servo/components/style/stylesheets/supports_rule.rs
+++ b/servo/components/style/stylesheets/supports_rule.rs
@@ -140,17 +140,17 @@ impl SupportsCondition {
         }
     }
 
     /// Parses a functional supports condition.
     fn parse_functional<'i, 't>(
         function: &str,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        match_ignore_ascii_case!{ function,
+        match_ignore_ascii_case! { function,
             // Although this is an internal syntax, it is not necessary
             // to check parsing context as far as we accept any
             // unexpected token as future syntax, and evaluate it to
             // false when not in chrome / ua sheet.
             // See https://drafts.csswg.org/css-conditional-3/#general_enclosed
             "-moz-bool-pref" => {
                 let name = {
                     let name = input.expect_string()?;
@@ -345,19 +345,18 @@ impl RawSelector {
                 let selector = Selector::<SelectorImpl>::parse(&parser, input)
                     .map_err(|_| input.new_custom_error(()))?;
 
                 #[cfg(feature = "gecko")]
                 {
                     use crate::selector_parser::PseudoElement;
                     use selectors::parser::Component;
 
-                    let has_any_unknown_webkit_pseudo = selector.has_pseudo_element() && selector
-                        .iter_raw_match_order()
-                        .any(|component| {
+                    let has_any_unknown_webkit_pseudo = selector.has_pseudo_element() &&
+                        selector.iter_raw_match_order().any(|component| {
                             matches!(
                                 *component,
                                 Component::PseudoElement(PseudoElement::UnknownWebkit(..))
                             )
                         });
                     if has_any_unknown_webkit_pseudo {
                         return Err(input.new_custom_error(()));
                     }
--- a/servo/components/style/stylesheets/viewport_rule.rs
+++ b/servo/components/style/stylesheets/viewport_rule.rs
@@ -2,29 +2,29 @@
  * 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/. */
 
 //! The [`@viewport`][at] at-rule and [`meta`][meta] element.
 //!
 //! [at]: https://drafts.csswg.org/css-device-adapt/#atviewport-rule
 //! [meta]: https://drafts.csswg.org/css-device-adapt/#viewport-meta
 
-use app_units::Au;
 use crate::context::QuirksMode;
 use crate::error_reporting::ContextualParseError;
 use crate::font_metrics::get_metrics_provider_for_product;
 use crate::media_queries::Device;
 use crate::parser::ParserContext;
 use crate::properties::StyleBuilder;
 use crate::rule_cache::RuleCacheConditions;
 use crate::shared_lock::{SharedRwLockReadGuard, StylesheetGuards, ToCssWithGuard};
 use crate::str::CssStringWriter;
 use crate::stylesheets::{Origin, StylesheetInDocument};
 use crate::values::computed::{Context, ToComputedValue};
 use crate::values::specified::{LengthOrPercentageOrAuto, NoCalcLength, ViewportPercentageLength};
+use app_units::Au;
 use cssparser::CowRcStr;
 use cssparser::{parse_important, AtRuleParser, DeclarationListParser, DeclarationParser, Parser};
 use euclid::TypedSize2D;
 use selectors::parser::SelectorParseErrorKind;
 use std::borrow::Cow;
 use std::cell::RefCell;
 use std::fmt::{self, Write};
 use std::iter::Enumerate;
--- a/servo/components/style/stylist.rs
+++ b/servo/components/style/stylist.rs
@@ -350,20 +350,17 @@ pub struct Stylist {
 
     /// Viewport constraints based on the current device.
     viewport_constraints: Option<ViewportConstraints>,
 
     /// The list of stylesheets.
     stylesheets: StylistStylesheetSet,
 
     /// If true, the quirks-mode stylesheet is applied.
-    #[cfg_attr(
-        feature = "servo",
-        ignore_malloc_size_of = "defined in selectors"
-    )]
+    #[cfg_attr(feature = "servo", ignore_malloc_size_of = "defined in selectors")]
     quirks_mode: QuirksMode,
 
     /// Selector maps for all of the style sheets in the stylist, after
     /// evalutaing media rules against the current device, split out per
     /// cascade level.
     cascade_data: DocumentCascadeData,
 
     /// Whether author styles are enabled.
@@ -1567,38 +1564,36 @@ impl<'a> SelectorVisitor for StylistSele
 
         // NOTE(emilio): This works properly right now because we can't store
         // complex selectors in nested selectors, otherwise we may need to
         // rethink this.
         //
         // Also, note that this call happens before we visit any of the simple
         // selectors in the next ComplexSelector, so we can use this to skip
         // looking at them.
-        self.passed_rightmost_selector =
-            self.passed_rightmost_selector ||
-                !matches!(combinator, None | Some(Combinator::PseudoElement));
+        self.passed_rightmost_selector = self.passed_rightmost_selector ||
+            !matches!(combinator, None | Some(Combinator::PseudoElement));
 
         true
     }
 
     fn visit_attribute_selector(
         &mut self,
         _ns: &NamespaceConstraint<&Namespace>,
         name: &LocalName,
         lower_name: &LocalName,
     ) -> bool {
         self.attribute_dependencies.insert(name.clone());
         self.attribute_dependencies.insert(lower_name.clone());
         true
     }
 
     fn visit_simple_selector(&mut self, s: &Component<SelectorImpl>) -> bool {
-        self.needs_revalidation =
-            self.needs_revalidation ||
-                component_needs_revalidation(s, self.passed_rightmost_selector);
+        self.needs_revalidation = self.needs_revalidation ||
+            component_needs_revalidation(s, self.passed_rightmost_selector);
 
         match *s {
             Component::NonTSPseudoClass(ref p) => {
                 self.state_dependencies.insert(p.state_flag());
                 self.document_state_dependencies
                     .insert(p.document_state_flag());
             },
             Component::ID(ref id) if !self.passed_rightmost_selector => {
@@ -2021,20 +2016,20 @@ impl CascadeData {
                         self.effective_media_query_results.saw_effective(media_rule);
                     }
                 },
                 CssRule::Keyframes(ref keyframes_rule) => {
                     let keyframes_rule = keyframes_rule.read_with(guard);
                     debug!("Found valid keyframes rule: {:?}", *keyframes_rule);
 
                     // Don't let a prefixed keyframes animation override a non-prefixed one.
-                    let needs_insertion = keyframes_rule.vendor_prefix.is_none() || self
-                        .animations
-                        .get(keyframes_rule.name.as_atom())
-                        .map_or(true, |rule| rule.vendor_prefix.is_some());
+                    let needs_insertion = keyframes_rule.vendor_prefix.is_none() ||
+                        self.animations
+                            .get(keyframes_rule.name.as_atom())
+                            .map_or(true, |rule| rule.vendor_prefix.is_some());
                     if needs_insertion {
                         let animation = KeyframesAnimation::from_keyframes(
                             &keyframes_rule.keyframes,
                             keyframes_rule.vendor_prefix.clone(),
                             guard,
                         );
                         debug!("Found valid keyframe animation: {:?}", animation);
                         self.animations
--- a/servo/components/style/traversal.rs
+++ b/servo/components/style/traversal.rs
@@ -203,21 +203,21 @@ pub trait DomTraversal<E: TElement>: Syn
             el, traversal_flags, data
         );
 
         // In case of animation-only traversal we need to traverse the element
         // if the element has animation only dirty descendants bit,
         // animation-only restyle hint or recascade.
         if traversal_flags.for_animation_only() {
             return data.map_or(false, |d| d.has_styles()) &&
-                (el.has_animation_only_dirty_descendants() || data
-                    .as_ref()
-                    .unwrap()
-                    .hint
-                    .has_animation_hint_or_recascade());
+                (el.has_animation_only_dirty_descendants() ||
+                    data.as_ref()
+                        .unwrap()
+                        .hint
+                        .has_animation_hint_or_recascade());
         }
 
         // Non-incremental layout visits every node.
         if is_servo_nonincremental_layout() {
             return true;
         }
 
         // Unwrap the data.
@@ -511,19 +511,18 @@ pub fn recalc_style_at<E, D, F>(
     // Additionally, there are a few scenarios where we avoid traversing the
     // subtree even if descendant styles are out of date. These cases are
     // enumerated in should_cull_subtree().
     let mut traverse_children = has_dirty_descendants_for_this_restyle ||
         !propagated_hint.is_empty() ||
         !child_cascade_requirement.can_skip_cascade() ||
         is_servo_nonincremental_layout();
 
-    traverse_children =
-        traverse_children &&
-            !traversal.should_cull_subtree(context, element, &data, is_initial_style);
+    traverse_children = traverse_children &&
+        !traversal.should_cull_subtree(context, element, &data, is_initial_style);
 
     // Examine our children, and enqueue the appropriate ones for traversal.
     if traverse_children {
         note_children::<E, D, F>(
             context,
             element,
             data,
             propagated_hint,
--- a/servo/components/style/values/animated/mod.rs
+++ b/servo/components/style/values/animated/mod.rs
@@ -3,24 +3,24 @@
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
 
 //! Animated values.
 //!
 //! Some values, notably colors, cannot be interpolated directly with their
 //! computed values and need yet another intermediate representation. This
 //! module's raison d'ĂȘtre is to ultimately contain all these types.
 
-use app_units::Au;
 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::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;
 mod length;
--- a/servo/components/style/values/computed/border.rs
+++ b/servo/components/style/values/computed/border.rs
@@ -1,25 +1,25 @@
 /* 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 app_units::Au;
 use crate::values::generics::NonNegative;
 use crate::values::computed::length::{NonNegativeLengthOrPercentage, NonNegativeLength};
 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 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>;
--- a/servo/components/style/values/computed/font.rs
+++ b/servo/components/style/values/computed/font.rs
@@ -1,29 +1,29 @@
 /* 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 values for font properties
 
-use app_units::Au;
-use byteorder::{BigEndian, ByteOrder};
 #[cfg(feature = "gecko")]
 use crate::gecko_bindings::sugar::refptr::RefPtr;
 #[cfg(feature = "gecko")]
 use crate::gecko_bindings::{bindings, structs};
 use crate::values::animated::{ToAnimatedValue, ToAnimatedZero};
 use crate::values::computed::{Angle, Context, Integer, NonNegativeLength, NonNegativePercentage};
 use crate::values::computed::{Number, Percentage, ToComputedValue};
 use crate::values::generics::font as generics;
 use crate::values::generics::font::{FeatureTagValue, FontSettings, VariationValue};
 use crate::values::specified::font::{self as specified, MAX_FONT_WEIGHT, MIN_FONT_WEIGHT};
 use crate::values::specified::length::{FontBaseSize, NoCalcLength};
 use crate::values::CSSFloat;
 use crate::Atom;
+use app_units::Au;
+use byteorder::{BigEndian, ByteOrder};
 use cssparser::{serialize_identifier, CssStringWriter, Parser};
 #[cfg(feature = "gecko")]
 use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
 use std::fmt::{self, Write};
 use std::hash::{Hash, Hasher};
 #[cfg(feature = "servo")]
 use std::slice;
 use style_traits::{CssWriter, ParseError, ToCss};
--- a/servo/components/style/values/computed/length.rs
+++ b/servo/components/style/values/computed/length.rs
@@ -1,25 +1,25 @@
 /* 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/. */
 
 //! `<length>` computed values, and related ones.
 
 use super::{Context, Number, Percentage, ToComputedValue};
-use app_units::Au;
 use crate::values::animated::{Animate, Procedure, ToAnimatedValue, ToAnimatedZero};
 use crate::values::distance::{ComputeSquaredDistance, SquaredDistance};
 use crate::values::generics::length::MaxLength as GenericMaxLength;
 use crate::values::generics::length::MozLength as GenericMozLength;
 use crate::values::generics::transform::IsZeroLength;
 use crate::values::generics::NonNegative;
 use crate::values::specified::length::ViewportPercentageLength;
 use crate::values::specified::length::{AbsoluteLength, FontBaseSize, FontRelativeLength};
 use crate::values::{specified, Auto, CSSFloat, Either, IsAuto, Normal};
+use app_units::Au;
 use ordered_float::NotNan;
 use std::fmt::{self, Write};
 use std::ops::{Add, Neg};
 use style_traits::values::specified::AllowedNumericType;
 use style_traits::{CssWriter, ToCss};
 
 pub use super::image::Image;
 pub use crate::values::specified::url::UrlOrNone;
--- a/servo/components/style/values/generics/basic_shape.rs
+++ b/servo/components/style/values/generics/basic_shape.rs
@@ -286,21 +286,17 @@ where
     B: ComputeSquaredDistance,
     T: PartialEq,
 {
     fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()> {
         match (self, other) {
             (
                 &ShapeSource::Shape(ref this, ref this_box),
                 &ShapeSource::Shape(ref other, ref other_box),
-            )
-                if this_box == other_box =>
-            {
-                this.compute_squared_distance(other)
-            },
+            ) if this_box == other_box => this.compute_squared_distance(other),
             (&ShapeSource::Path(ref this), &ShapeSource::Path(ref other))
                 if this.fill == other.fill =>
             {
                 this.path.compute_squared_distance(&other.path)
             },
             _ => Err(()),
         }
     }
--- a/servo/components/style/values/generics/font.rs
+++ b/servo/components/style/values/generics/font.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/. */
 
 //! Generic types for font stuff.
 
+use crate::parser::{Parse, ParserContext};
 use app_units::Au;
 use byteorder::{BigEndian, ReadBytesExt};
-use crate::parser::{Parse, ParserContext};
 use cssparser::Parser;
 use num_traits::One;
 use std::fmt::{self, Write};
 use std::io::Cursor;
 use style_traits::{CssWriter, KeywordsCollectFn, ParseError};
 use style_traits::{SpecifiedValueInfo, StyleParseErrorKind, ToCss};
 
 /// https://drafts.csswg.org/css-fonts-4/#feature-tag-value
--- a/servo/components/style/values/generics/text.rs
+++ b/servo/components/style/values/generics/text.rs
@@ -1,18 +1,18 @@
 /* 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/. */
 
 //! Generic types for text properties.
 
-use app_units::Au;
 use crate::parser::ParserContext;
 use crate::values::animated::{Animate, Procedure, ToAnimatedZero};
 use crate::values::distance::{ComputeSquaredDistance, SquaredDistance};
+use app_units::Au;
 use cssparser::Parser;
 use style_traits::ParseError;
 
 /// A generic value for the `initial-letter` property.
 #[derive(
     Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
 )]
 pub enum InitialLetter<Number, Integer> {
--- a/servo/components/style/values/generics/transform.rs
+++ b/servo/components/style/values/generics/transform.rs
@@ -1,21 +1,21 @@
 /* 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/. */
 
 //! Generic types for CSS values that are related to transformations.
 
-use app_units::Au;
 use crate::values::computed::length::Length as ComputedLength;
 use crate::values::computed::length::LengthOrPercentage as ComputedLengthOrPercentage;
 use crate::values::specified::angle::Angle as SpecifiedAngle;
 use crate::values::specified::length::Length as SpecifiedLength;
 use crate::values::specified::length::LengthOrPercentage as SpecifiedLengthOrPercentage;
 use crate::values::{computed, CSSFloat};
+use app_units::Au;
 use euclid::{self, Rect, Transform3D};
 use num_traits::Zero;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ToCss};
 
 /// A generic 2D transformation matrix.
 #[allow(missing_docs)]
 #[derive(
--- a/servo/components/style/values/mod.rs
+++ b/servo/components/style/values/mod.rs
@@ -88,20 +88,17 @@ pub fn serialize_percentage<W>(value: CS
 where
     W: Write,
 {
     (value * 100.).to_css(dest)?;
     dest.write_str("%")
 }
 
 /// Convenience void type to disable some properties and values through types.
-#[cfg_attr(
-    feature = "servo",
-    derive(Deserialize, MallocSizeOf, Serialize)
-)]
+#[cfg_attr(feature = "servo", derive(Deserialize, MallocSizeOf, Serialize))]
 #[derive(
     Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToComputedValue, ToCss,
 )]
 pub enum Impossible {}
 
 // FIXME(nox): This should be derived but the derive code cannot cope
 // with uninhabited enums.
 impl ComputeSquaredDistance for Impossible {
--- a/servo/components/style/values/specified/angle.rs
+++ b/servo/components/style/values/specified/angle.rs
@@ -188,17 +188,17 @@ impl Angle {
             } => {
                 Angle::parse_dimension(value, unit, /* from_calc = */ false)
             },
             Token::Number { value, .. } if value == 0. => match allow_unitless_zero {
                 AllowUnitlessZeroAngle::Yes => Ok(Angle::zero()),
                 AllowUnitlessZeroAngle::No => Err(()),
             },
             Token::Function(ref name) if name.eq_ignore_ascii_case("calc") => {
-                return input.parse_nested_block(|i| CalcNode::parse_angle(context, i))
+                return input.parse_nested_block(|i| CalcNode::parse_angle(context, i));
             },
             _ => Err(()),
         }
         .map_err(|()| input.new_unexpected_token_error(token.clone()))
     }
 }
 
 impl SpecifiedValueInfo for Angle {}
--- a/servo/components/style/values/specified/box.rs
+++ b/servo/components/style/values/specified/box.rs
@@ -213,20 +213,17 @@ impl Display {
             #[cfg(feature = "gecko")]
             Display::InlineGrid => Display::Grid,
             #[cfg(feature = "gecko")]
             Display::WebkitInlineBox => Display::WebkitBox,
 
             // Special handling for contents and list-item on the root
             // element for Gecko.
             #[cfg(feature = "gecko")]
-            Display::Contents | Display::ListItem if _is_root_element =>
-            {
-                Display::Block
-            },
+            Display::Contents | Display::ListItem if _is_root_element => Display::Block,
 
             // These are not changed by blockification.
             Display::None | Display::Block | Display::Flex | Display::ListItem | Display::Table => {
                 *self
             },
 
             #[cfg(feature = "gecko")]
             Display::Contents | Display::FlowRoot | Display::Grid | Display::WebkitBox => *self,
@@ -742,17 +739,19 @@ impl Parse for Contain {
                 "content" if result.is_empty() => return Ok(Contain::CONTENT | Contain::CONTENT_BITS),
                 "none" if result.is_empty() => return Ok(result),
                 _ => None
             };
 
             let flag = match flag {
                 Some(flag) if !result.contains(flag) => flag,
                 _ => {
-                    return Err(input.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(name)))
+                    return Err(
+                        input.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(name))
+                    );
                 },
             };
             result.insert(flag);
         }
 
         if !result.is_empty() {
             Ok(result)
         } else {
@@ -821,17 +820,17 @@ impl Parse for TransitionProperty {
 
         let id = match PropertyId::parse_ignoring_rule_type(&ident, context) {
             Ok(id) => id,
             Err(..) => {
                 return Ok(TransitionProperty::Unsupported(CustomIdent::from_ident(
                     location,
                     ident,
                     &["none"],
-                )?))
+                )?));
             },
         };
 
         Ok(match id.as_shorthand() {
             Ok(s) => TransitionProperty::Shorthand(s),
             Err(longhand_or_custom) => match longhand_or_custom {
                 PropertyDeclarationId::Longhand(id) => TransitionProperty::Longhand(id),
                 PropertyDeclarationId::Custom(custom) => TransitionProperty::Custom(custom.clone()),
@@ -1304,17 +1303,17 @@ impl BreakBetween {
     #[inline]
     pub fn parse_legacy<'i>(input: &mut Parser<'i, '_>) -> Result<Self, ParseError<'i>> {
         let location = input.current_source_location();
         let ident = input.expect_ident()?;
         let break_value = match BreakBetween::from_ident(ident) {
             Ok(v) => v,
             Err(()) => {
                 return Err(location
-                    .new_custom_error(SelectorParseErrorKind::UnexpectedIdent(ident.clone())))
+                    .new_custom_error(SelectorParseErrorKind::UnexpectedIdent(ident.clone())));
             },
         };
         match break_value {
             BreakBetween::Always => Ok(BreakBetween::Page),
             BreakBetween::Auto | BreakBetween::Avoid | BreakBetween::Left | BreakBetween::Right => {
                 Ok(break_value)
             },
             BreakBetween::Page => {
--- a/servo/components/style/values/specified/calc.rs
+++ b/servo/components/style/values/specified/calc.rs
@@ -175,17 +175,17 @@ impl CalcNode {
             (
                 &Token::Dimension {
                     value, ref unit, ..
                 },
                 CalcUnit::LengthOrPercentage,
             ) => {
                 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)
@@ -199,17 +199,17 @@ impl CalcNode {
                 CalcUnit::Time,
             ) => {
                 return Time::parse_dimension(value, unit, /* from_calc = */ true)
                     .map(CalcNode::Time)
                     .map_err(|()| location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
             },
             (&Token::Percentage { unit_value, .. }, CalcUnit::LengthOrPercentage) |
             (&Token::Percentage { unit_value, .. }, CalcUnit::Percentage) => {
-                return Ok(CalcNode::Percentage(unit_value))
+                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())),
         }
         input.parse_nested_block(|i| CalcNode::parse(context, i, expected_unit))
     }
 
--- a/servo/components/style/values/specified/counters.rs
+++ b/servo/components/style/values/specified/counters.rs
@@ -176,17 +176,17 @@ impl Parse for Content {
                         })),
                         _ => None
                     };
                     match result {
                         Some(result) => content.push(result?),
                         None => {
                             return Err(input.new_custom_error(
                                 StyleParseErrorKind::UnexpectedFunction(name.clone()),
-                            ))
+                            ));
                         },
                     }
                 },
                 Ok(Token::Ident(ref ident)) => {
                     content.push(match_ignore_ascii_case! { &ident,
                         "open-quote" => generics::ContentItem::OpenQuote,
                         "close-quote" => generics::ContentItem::CloseQuote,
                         "no-open-quote" => generics::ContentItem::NoOpenQuote,
--- a/servo/components/style/values/specified/font.rs
+++ b/servo/components/style/values/specified/font.rs
@@ -1,32 +1,32 @@
 /* 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 values for font properties
 
-use app_units::Au;
-use byteorder::{BigEndian, ByteOrder};
 #[cfg(feature = "gecko")]
 use crate::gecko_bindings::bindings;
 use crate::parser::{Parse, ParserContext};
 use crate::properties::longhands::system_font::SystemFont;
 use crate::values::computed::font::{FamilyName, FontFamilyList, FontStyleAngle, SingleFontFamily};
 use crate::values::computed::{font as computed, Length, NonNegativeLength};
 use crate::values::computed::{Angle as ComputedAngle, Percentage as ComputedPercentage};
 use crate::values::computed::{Context, ToComputedValue};
 use crate::values::generics::font::{self as generics, FeatureTagValue, FontSettings, FontTag};
 use crate::values::generics::font::{KeywordSize, VariationValue};
 use crate::values::generics::NonNegative;
 use crate::values::specified::length::{FontBaseSize, AU_PER_PT, AU_PER_PX};
 use crate::values::specified::{AllowQuirks, Angle, Integer, LengthOrPercentage};
 use crate::values::specified::{NoCalcLength, Number, Percentage};
 use crate::values::CustomIdent;
 use crate::Atom;
+use app_units::Au;
+use byteorder::{BigEndian, ByteOrder};
 use cssparser::{Parser, Token};
 #[cfg(feature = "gecko")]
 use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
 use std::fmt::{self, Write};
 use style_traits::values::SequenceWriter;
 use style_traits::{CssWriter, KeywordsCollectFn, ParseError};
 use style_traits::{SpecifiedValueInfo, StyleParseErrorKind, ToCss};
 
--- a/servo/components/style/values/specified/grid.rs
+++ b/servo/components/style/values/specified/grid.rs
@@ -17,21 +17,17 @@ use std::mem;
 use style_traits::{ParseError, StyleParseErrorKind};
 
 /// Parse a single flexible length.
 pub fn parse_flex<'i, 't>(input: &mut Parser<'i, 't>) -> Result<CSSFloat, ParseError<'i>> {
     let location = input.current_source_location();
     match *input.next()? {
         Token::Dimension {
             value, ref unit, ..
-        }
-            if unit.eq_ignore_ascii_case("fr") && value.is_sign_positive() =>
-        {
-            Ok(value)
-        },
+        } if unit.eq_ignore_ascii_case("fr") && value.is_sign_positive() => Ok(value),
         ref t => Err(location.new_unexpected_token_error(t.clone())),
     }
 }
 
 impl Parse for TrackBreadth<LengthOrPercentage> {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
--- a/servo/components/style/values/specified/image.rs
+++ b/servo/components/style/values/specified/image.rs
@@ -257,17 +257,17 @@ impl Parse for Gradient {
                 });
             },
             _ => None,
         };
 
         let (shape, repeating, mut compat_mode) = match result {
             Some(result) => result,
             None => {
-                return Err(input.new_custom_error(StyleParseErrorKind::UnexpectedFunction(func)))
+                return Err(input.new_custom_error(StyleParseErrorKind::UnexpectedFunction(func)));
             },
         };
 
         #[cfg(feature = "gecko")]
         {
             use crate::gecko_bindings::structs;
             if compat_mode == CompatMode::Moz &&
                 !unsafe { structs::StaticPrefs_sVarCache_layout_css_prefixes_gradients }
@@ -787,17 +787,17 @@ impl LineDirection {
                 // According to Gecko, `-moz-linear-gradient(to ...)` should serialize like
                 // `linear-gradient(to ...)`.
                 CompatMode::Moz if to_ident.is_ok() => *compat_mode = CompatMode::Modern,
                 // There is no `to` keyword in webkit prefixed syntax. If it's consumed,
                 // parsing should throw an error.
                 CompatMode::WebKit if to_ident.is_ok() => {
                     return Err(
                         i.new_custom_error(SelectorParseErrorKind::UnexpectedIdent("to".into()))
-                    )
+                    );
                 },
                 _ => {},
             }
 
             #[cfg(feature = "gecko")]
             {
                 // `-moz-` prefixed linear gradient can be both Angle and Position.
                 if *compat_mode == CompatMode::Moz {
--- a/servo/components/style/values/specified/length.rs
+++ b/servo/components/style/values/specified/length.rs
@@ -2,26 +2,26 @@
  * 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/. */
 
 //! [Length values][length].
 //!
 //! [length]: https://drafts.csswg.org/css-values/#lengths
 
 use super::{AllowQuirks, Number, Percentage, ToComputedValue};
-use app_units::Au;
 use crate::font_metrics::FontMetricsQueryResult;
 use crate::parser::{Parse, ParserContext};
 use crate::values::computed::{self, CSSPixelLength, Context, ExtremumLength};
 use crate::values::generics::length::MaxLength as GenericMaxLength;
 use crate::values::generics::length::MozLength as GenericMozLength;
 use crate::values::generics::transform::IsZeroLength;
 use crate::values::generics::NonNegative;
 use crate::values::specified::calc::CalcNode;
 use crate::values::{Auto, CSSFloat, Either, IsAuto, Normal};
+use app_units::Au;
 use cssparser::{Parser, Token};
 use euclid::Size2D;
 use std::cmp;
 use std::ops::{Add, Mul};
 use style_traits::values::specified::AllowedNumericType;
 use style_traits::{ParseError, SpecifiedValueInfo, StyleParseErrorKind};
 
 pub use super::image::{ColorStop, EndingShape as GradientEndingShape, Gradient};
@@ -596,22 +596,20 @@ impl Length {
     ) -> Result<Self, ParseError<'i>> {
         // FIXME: remove early returns when lifetimes are non-lexical
         {
             let location = input.current_source_location();
             let token = input.next()?;
             match *token {
                 Token::Dimension {
                     value, ref unit, ..
-                }
-                    if num_context.is_ok(context.parsing_mode, value) =>
-                {
+                } if num_context.is_ok(context.parsing_mode, value) => {
                     return NoCalcLength::parse_dimension(context, value, unit)
                         .map(Length::NoCalc)
-                        .map_err(|()| location.new_unexpected_token_error(token.clone()))
+                        .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));
                     }
@@ -795,30 +793,28 @@ impl LengthOrPercentage {
     ) -> Result<Self, ParseError<'i>> {
         // FIXME: remove early returns when lifetimes are non-lexical
         {
             let location = input.current_source_location();
             let token = input.next()?;
             match *token {
                 Token::Dimension {
                     value, ref unit, ..
-                }
-                    if num_context.is_ok(context.parsing_mode, value) =>
-                {
+                } if num_context.is_ok(context.parsing_mode, value) => {
                     return NoCalcLength::parse_dimension(context, value, unit)
                         .map(LengthOrPercentage::Length)
-                        .map_err(|()| location.new_unexpected_token_error(token.clone()))
+                        .map_err(|()| location.new_unexpected_token_error(token.clone()));
                 },
                 Token::Percentage { unit_value, .. }
                     if num_context.is_ok(context.parsing_mode, unit_value) =>
                 {
                     return Ok(LengthOrPercentage::Percentage(computed::Percentage(
                         unit_value,
-                    )))
-                },
+                    )));
+                }
                 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_unexpected_token_error(token.clone()));
                     } else {
                         return Ok(LengthOrPercentage::Length(NoCalcLength::from_px(value)));
@@ -927,43 +923,41 @@ impl LengthOrPercentageOrAuto {
     ) -> Result<Self, ParseError<'i>> {
         // FIXME: remove early returns when lifetimes are non-lexical
         {
             let location = input.current_source_location();
             let token = input.next()?;
             match *token {
                 Token::Dimension {
                     value, ref unit, ..
-                }
-                    if num_context.is_ok(context.parsing_mode, value) =>
-                {
+                } if num_context.is_ok(context.parsing_mode, value) => {
                     return NoCalcLength::parse_dimension(context, value, unit)
                         .map(LengthOrPercentageOrAuto::Length)
-                        .map_err(|()| location.new_unexpected_token_error(token.clone()))
+                        .map_err(|()| location.new_unexpected_token_error(token.clone()));
                 },
                 Token::Percentage { unit_value, .. }
                     if num_context.is_ok(context.parsing_mode, unit_value) =>
                 {
                     return Ok(LengthOrPercentageOrAuto::Percentage(computed::Percentage(
                         unit_value,
-                    )))
-                },
+                    )));
+                }
                 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 Ok(LengthOrPercentageOrAuto::Length(NoCalcLength::Absolute(
                         AbsoluteLength::Px(value),
                     )));
                 },
                 Token::Ident(ref value) if value.eq_ignore_ascii_case("auto") => {
-                    return Ok(LengthOrPercentageOrAuto::Auto)
+                    return Ok(LengthOrPercentageOrAuto::Auto);
                 },
                 Token::Function(ref name) if name.eq_ignore_ascii_case("calc") => {},
                 _ => return Err(location.new_unexpected_token_error(token.clone())),
             }
         }
 
         let calc = input.parse_nested_block(|i| {
             CalcNode::parse_length_or_percentage(context, i, num_context)
@@ -1093,44 +1087,42 @@ impl LengthOrPercentageOrNone {
     ) -> Result<Self, ParseError<'i>> {
         // FIXME: remove early returns when lifetimes are non-lexical
         {
             let location = input.current_source_location();
             let token = input.next()?;
             match *token {
                 Token::Dimension {
                     value, ref unit, ..
-                }
-                    if num_context.is_ok(context.parsing_mode, value) =>
-                {
+                } if num_context.is_ok(context.parsing_mode, value) => {
                     return NoCalcLength::parse_dimension(context, value, unit)
                         .map(LengthOrPercentageOrNone::Length)
-                        .map_err(|()| location.new_unexpected_token_error(token.clone()))
+                        .map_err(|()| location.new_unexpected_token_error(token.clone()));
                 },
                 Token::Percentage { unit_value, .. }
                     if num_context.is_ok(context.parsing_mode, unit_value) =>
                 {
                     return Ok(LengthOrPercentageOrNone::Percentage(computed::Percentage(
                         unit_value,
-                    )))
-                },
+                    )));
+                }
                 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 Ok(LengthOrPercentageOrNone::Length(NoCalcLength::Absolute(
                         AbsoluteLength::Px(value),
                     )));
                 },
                 Token::Function(ref name) if name.eq_ignore_ascii_case("calc") => {},
                 Token::Ident(ref value) if value.eq_ignore_ascii_case("none") => {
-                    return Ok(LengthOrPercentageOrNone::None)
+                    return Ok(LengthOrPercentageOrNone::None);
                 },
                 _ => return Err(location.new_unexpected_token_error(token.clone())),
             }
         }
 
         let calc = input.parse_nested_block(|i| {
             CalcNode::parse_length_or_percentage(context, i, num_context)
         })?;
--- a/servo/components/style/values/specified/mod.rs
+++ b/servo/components/style/values/specified/mod.rs
@@ -133,17 +133,17 @@ fn parse_number_with_clamping_mode<'i, '
 ) -> Result<Number, ParseError<'i>> {
     let location = input.current_source_location();
     // FIXME: remove early returns when lifetimes are non-lexical
     match *input.next()? {
         Token::Number { value, .. } if clamping_mode.is_ok(context.parsing_mode, value) => {
             return Ok(Number {
                 value: value.min(f32::MAX).max(f32::MIN),
                 calc_clamping_mode: None,
-            })
+            });
         },
         Token::Function(ref name) if name.eq_ignore_ascii_case("calc") => {},
         ref t => return Err(location.new_unexpected_token_error(t.clone())),
     }
 
     let result = input.parse_nested_block(|i| CalcNode::parse_number(context, i))?;
 
     Ok(Number {
@@ -823,17 +823,17 @@ impl Attr {
                     };
 
                     let prefix_and_ns = if let Some(ns) = first {
                         let prefix = Prefix::from(ns.as_ref());
                         let ns = match get_namespace_for_prefix(&prefix, context) {
                             Some(ns) => ns,
                             None => {
                                 return Err(location
-                                    .new_custom_error(StyleParseErrorKind::UnspecifiedError))
+                                    .new_custom_error(StyleParseErrorKind::UnspecifiedError));
                             },
                         };
                         Some((prefix, ns))
                     } else {
                         None
                     };
                     return Ok(Attr {
                         namespace: prefix_and_ns,
--- a/servo/components/style/values/specified/source_size_list.rs
+++ b/servo/components/style/values/specified/source_size_list.rs
@@ -1,21 +1,21 @@
 /* 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/. */
 
 //! https://html.spec.whatwg.org/multipage/#source-size-list
 
-use app_units::Au;
 #[cfg(feature = "gecko")]
 use crate::gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI};
 use crate::media_queries::{Device, MediaCondition};
 use crate::parser::{Parse, ParserContext};
 use crate::values::computed::{self, ToComputedValue};
 use crate::values::specified::{Length, NoCalcLength, ViewportPercentageLength};
+use app_units::Au;
 use cssparser::{Delimiter, Parser, Token};
 use selectors::context::QuirksMode;
 use style_traits::ParseError;
 
 /// A value for a `<source-size>`:
 ///
 /// https://html.spec.whatwg.org/multipage/#source-size
 #[derive(Debug)]
@@ -113,17 +113,17 @@ impl SourceSizeList {
                 SourceSizeOrLength::parse(context, input)
             });
 
             match result {
                 Ok(SourceSizeOrLength::Length(value)) => {
                     return Self {
                         source_sizes,
                         value: Some(value),
-                    }
+                    };
                 },
                 Ok(SourceSizeOrLength::SourceSize(source_size)) => {
                     source_sizes.push(source_size);
                 },
                 Err(..) => {},
             }
 
             match input.next() {
--- a/servo/components/style/values/specified/text.rs
+++ b/servo/components/style/values/specified/text.rs
@@ -86,18 +86,17 @@ impl Parse for LineHeight {
         if let Ok(nlop) = input.try(|i| NonNegativeLengthOrPercentage::parse(context, i)) {
             return Ok(GenericLineHeight::Length(nlop));
         }
         let location = input.current_source_location();
         let ident = input.expect_ident()?;
         match ident {
             ref ident if ident.eq_ignore_ascii_case("normal") => Ok(GenericLineHeight::Normal),
             #[cfg(feature = "gecko")]
-            ref ident if ident.eq_ignore_ascii_case("-moz-block-height") =>
-            {
+            ref ident if ident.eq_ignore_ascii_case("-moz-block-height") => {
                 Ok(GenericLineHeight::MozBlockHeight)
             },
             ident => {
                 Err(location
                     .new_custom_error(SelectorParseErrorKind::UnexpectedIdent(ident.clone())))
             },
         }
     }
--- a/servo/components/style/values/specified/time.rs
+++ b/servo/components/style/values/specified/time.rs
@@ -87,22 +87,20 @@ impl Time {
         match input.next() {
             // 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) =>
-            {
+            }) 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));
-            }
+            },
             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
@@ -167,19 +167,17 @@ where
     }
 }
 
 fn path_to_ident(path: &Path) -> Option<&Ident> {
     match *path {
         Path {
             leading_colon: None,
             ref segments,
-        }
-            if segments.len() == 1 =>
-        {
+        } if segments.len() == 1 => {
             if segments[0].arguments.is_empty() {
                 Some(&segments[0].ident)
             } else {
                 None
             }
         },
         _ => None,
     }
--- a/servo/components/style_derive/parse.rs
+++ b/servo/components/style_derive/parse.rs
@@ -38,17 +38,17 @@ pub fn derive(input: DeriveInput) -> Tok
                 .keyword
                 .unwrap_or(variant.ast().ident.to_string()),
         );
         let ident = &variant.ast().ident;
 
         saw_condition |= parse_attrs.condition.is_some();
         let condition = match parse_attrs.condition {
             Some(ref p) => quote! { if #p(context) },
-            None => quote!{},
+            None => quote! {},
         };
 
         let mut body = quote! {
             #match_body
             #identifier #condition => Ok(#name::#ident),
         };
 
         let aliases = match parse_attrs.aliases {
--- a/servo/components/style_traits/lib.rs
+++ b/servo/components/style_traits/lib.rs
@@ -43,20 +43,17 @@ use servo_atoms::Atom;
 /// This unit corresponds to the smallest addressable element of the display hardware.
 #[cfg(not(feature = "servo"))]
 #[derive(Clone, Copy, Debug)]
 pub enum DevicePixel {}
 
 /// Represents a mobile style pinch zoom factor.
 /// TODO(gw): Once WR supports pinch zoom, use a type directly from webrender_api.
 #[derive(Clone, Copy, Debug, PartialEq)]
-#[cfg_attr(
-    feature = "servo",
-    derive(Deserialize, Serialize, MallocSizeOf)
-)]
+#[cfg_attr(feature = "servo", derive(Deserialize, Serialize, MallocSizeOf))]
 pub struct PinchZoomFactor(f32);
 
 impl PinchZoomFactor {
     /// Construct a new pinch zoom factor.
     pub fn new(scale: f32) -> PinchZoomFactor {
         PinchZoomFactor(scale)
     }
 
--- a/servo/components/style_traits/viewport.rs
+++ b/servo/components/style_traits/viewport.rs
@@ -23,20 +23,17 @@ define_css_keyword_enum! {
         Landscape = "landscape",
     }
 }
 
 /// A set of viewport descriptors:
 ///
 /// <https://drafts.csswg.org/css-device-adapt/#viewport-desc>
 #[derive(Clone, Debug, PartialEq)]
-#[cfg_attr(
-    feature = "servo",
-    derive(Deserialize, Serialize, MallocSizeOf)
-)]
+#[cfg_attr(feature = "servo", derive(Deserialize, Serialize, MallocSizeOf))]
 pub struct ViewportConstraints {
     /// Width and height:
     ///  * https://drafts.csswg.org/css-device-adapt/#width-desc
     ///  * https://drafts.csswg.org/css-device-adapt/#height-desc
     pub size: TypedSize2D<f32, CSSPixel>,
     /// <https://drafts.csswg.org/css-device-adapt/#zoom-desc>
     pub initial_zoom: PinchZoomFactor,
     /// <https://drafts.csswg.org/css-device-adapt/#min-max-width-desc>