No bug - Rustfmt recent changes. r=whitespace-only
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sat, 23 Feb 2019 20:40:02 -0800
changeset 518634 d097f97a8e0c916e12af6617c4533749c16fc082
parent 518633 ed82f0303683acee9eba6f53ef77fd91604077f2
child 518635 72673a5b4c1c6b2ba0a4e88c558ea22ca8877961
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhitespace-only
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
No bug - Rustfmt recent changes. r=whitespace-only
servo/components/style/gecko/media_queries.rs
servo/components/style/gecko_bindings/sugar/style_complex_color.rs
servo/components/style/values/computed/length.rs
servo/components/style/values/computed/transform.rs
servo/components/style/values/generics/background.rs
servo/components/style/values/generics/mod.rs
servo/components/style/values/generics/position.rs
servo/components/style/values/generics/transform.rs
servo/components/style/values/specified/box.rs
servo/components/style/values/specified/font.rs
servo/components/style/values/specified/length.rs
servo/components/style/values/specified/mod.rs
servo/components/style/values/specified/svg.rs
servo/components/style/values/specified/text.rs
servo/components/style_derive/parse.rs
--- a/servo/components/style/gecko/media_queries.rs
+++ b/servo/components/style/gecko/media_queries.rs
@@ -80,17 +80,19 @@ unsafe impl Sync for Device {}
 unsafe impl Send for Device {}
 
 impl Device {
     /// Trivially constructs a new `Device`.
     pub fn new(pres_context: RawGeckoPresContextBorrowed) -> Self {
         assert!(!pres_context.is_null());
         Device {
             pres_context,
-            default_values: ComputedValues::default_values(unsafe { &*(*pres_context).mDocument.mRawPtr }),
+            default_values: ComputedValues::default_values(unsafe {
+                &*(*pres_context).mDocument.mRawPtr
+            }),
             // FIXME(bz): Seems dubious?
             root_font_size: AtomicIsize::new(FontSize::medium().size().0 as isize),
             body_text_color: AtomicUsize::new(unsafe { &*pres_context }.mDefaultColor as usize),
             used_root_font_size: AtomicBool::new(false),
             used_viewport_size: AtomicBool::new(false),
             environment: CssEnvironment,
         }
     }
--- a/servo/components/style/gecko_bindings/sugar/style_complex_color.rs
+++ b/servo/components/style/gecko_bindings/sugar/style_complex_color.rs
@@ -3,17 +3,19 @@
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
 
 //! Rust helpers to interact with Gecko's StyleComplexColor.
 
 use crate::gecko::values::{convert_nscolor_to_rgba, convert_rgba_to_nscolor};
 use crate::gecko_bindings::structs::StyleComplexColor;
 use crate::gecko_bindings::structs::StyleComplexColor_Tag as Tag;
 use crate::values::computed::{Color as ComputedColor, ColorOrAuto, RGBAColor as ComputedRGBA};
-use crate::values::generics::color::{Color as GenericColor, ColorOrAuto as GenericColorOrAuto, ComplexColorRatios};
+use crate::values::generics::color::{
+    Color as GenericColor, ColorOrAuto as GenericColorOrAuto, ComplexColorRatios,
+};
 
 impl StyleComplexColor {
     /// Create a `StyleComplexColor` value that represents `currentColor`.
     pub fn current_color() -> Self {
         StyleComplexColor {
             mColor: 0,
             mBgRatio: 0.,
             mFgRatio: 1.,
--- a/servo/components/style/values/computed/length.rs
+++ b/servo/components/style/values/computed/length.rs
@@ -4,17 +4,19 @@
 
 //! `<length>` computed values, and related ones.
 
 use super::{Context, Number, Percentage, ToComputedValue};
 use crate::values::animated::ToAnimatedValue;
 use crate::values::computed::NonNegativeNumber;
 use crate::values::distance::{ComputeSquaredDistance, SquaredDistance};
 use crate::values::generics::length as generics;
-use crate::values::generics::length::{MaxSize as GenericMaxSize, Size as GenericSize, GenericLengthOrNumber};
+use crate::values::generics::length::{
+    GenericLengthOrNumber, MaxSize as GenericMaxSize, Size as GenericSize,
+};
 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, Normal};
 use app_units::Au;
 use ordered_float::NotNan;
 use std::fmt::{self, Write};
--- a/servo/components/style/values/computed/transform.rs
+++ b/servo/components/style/values/computed/transform.rs
@@ -16,17 +16,18 @@ pub use crate::values::generics::transfo
 
 /// A single operation in a computed CSS `transform`
 pub type TransformOperation =
     generic::TransformOperation<Angle, Number, Length, Integer, LengthPercentage>;
 /// A computed CSS `transform`
 pub type Transform = generic::Transform<TransformOperation>;
 
 /// The computed value of a CSS `<transform-origin>`
-pub type TransformOrigin = generic::GenericTransformOrigin<LengthPercentage, LengthPercentage, Length>;
+pub type TransformOrigin =
+    generic::GenericTransformOrigin<LengthPercentage, LengthPercentage, Length>;
 
 /// A vector to represent the direction vector (rotate axis) for Rotate3D.
 pub type DirectionVector = Vector3D<CSSFloat>;
 
 impl TransformOrigin {
     /// Returns the initial computed value for `transform-origin`.
     #[inline]
     pub fn initial_value() -> Self {
--- a/servo/components/style/values/generics/background.rs
+++ b/servo/components/style/values/generics/background.rs
@@ -1,15 +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/. */
 
 //! Generic types for CSS values related to backgrounds.
 
-use crate::values::generics::length::{LengthPercentageOrAuto, GenericLengthPercentageOrAuto};
+use crate::values::generics::length::{GenericLengthPercentageOrAuto, LengthPercentageOrAuto};
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ToCss};
 
 /// A generic value for the `background-size` property.
 #[derive(
     Animate,
     Clone,
     ComputeSquaredDistance,
--- a/servo/components/style/values/generics/mod.rs
+++ b/servo/components/style/values/generics/mod.rs
@@ -122,18 +122,18 @@ impl Parse for CounterStyleOrNone {
         input.expect_function_matching("symbols")?;
         input.parse_nested_block(|input| {
             let symbols_type = input
                 .try(SymbolsType::parse)
                 .unwrap_or(SymbolsType::Symbolic);
             let symbols = Symbols::parse(context, input)?;
             // There must be at least two symbols for alphabetic or
             // numeric system.
-            if (symbols_type == SymbolsType::Alphabetic ||
-                symbols_type == SymbolsType::Numeric) && symbols.0.len() < 2
+            if (symbols_type == SymbolsType::Alphabetic || symbols_type == SymbolsType::Numeric) &&
+                symbols.0.len() < 2
             {
                 return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
             }
             // Identifier is not allowed in symbols() function.
             if symbols.0.iter().any(|sym| !sym.is_allowed_in_symbols()) {
                 return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
             }
             Ok(CounterStyleOrNone::Symbols(symbols_type, symbols))
@@ -172,25 +172,25 @@ impl SpecifiedValueInfo for CounterStyle
     SpecifiedValueInfo,
     ToAnimatedZero,
     ToComputedValue,
     ToCss,
 )]
 #[repr(transparent)]
 pub struct NonNegative<T>(pub T);
 
-impl <T: Add<Output = T>> Add<NonNegative<T>> for NonNegative<T> {
+impl<T: Add<Output = T>> Add<NonNegative<T>> for NonNegative<T> {
     type Output = Self;
 
     fn add(self, other: Self) -> Self {
         NonNegative(self.0 + other.0)
     }
 }
 
-impl <T: Zero> Zero for NonNegative<T> {
+impl<T: Zero> Zero for NonNegative<T> {
     fn is_zero(&self) -> bool {
         self.0.is_zero()
     }
 
     fn zero() -> Self {
         NonNegative(T::zero())
     }
 }
--- a/servo/components/style/values/generics/position.rs
+++ b/servo/components/style/values/generics/position.rs
@@ -27,17 +27,20 @@ pub struct GenericPosition<H, V> {
     pub vertical: V,
 }
 
 pub use self::GenericPosition as Position;
 
 impl<H, V> Position<H, V> {
     /// Returns a new position.
     pub fn new(horizontal: H, vertical: V) -> Self {
-        Self { horizontal, vertical }
+        Self {
+            horizontal,
+            vertical,
+        }
     }
 }
 
 /// A generic value for the `z-index` property.
 #[derive(
     Animate,
     Clone,
     ComputeSquaredDistance,
--- a/servo/components/style/values/generics/transform.rs
+++ b/servo/components/style/values/generics/transform.rs
@@ -93,17 +93,21 @@ pub struct GenericTransformOrigin<H, V, 
     pub depth: Depth,
 }
 
 pub use self::GenericTransformOrigin as TransformOrigin;
 
 impl<H, V, D> TransformOrigin<H, V, D> {
     /// Returns a new transform origin.
     pub fn new(horizontal: H, vertical: V, depth: D) -> Self {
-        Self { horizontal, vertical, depth }
+        Self {
+            horizontal,
+            vertical,
+            depth,
+        }
     }
 }
 
 #[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
 /// A single operation in the list of a `transform` value
 pub enum TransformOperation<Angle, Number, Length, Integer, LengthPercentage> {
     /// Represents a 2D 2x3 matrix.
     Matrix(Matrix<Number>),
--- a/servo/components/style/values/specified/box.rs
+++ b/servo/components/style/values/specified/box.rs
@@ -414,26 +414,17 @@ pub enum ScrollSnapAlignKeyword {
     Start,
     End,
     Center,
 }
 
 /// https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-align
 #[allow(missing_docs)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(
-    Clone,
-    Copy,
-    Debug,
-    Eq,
-    MallocSizeOf,
-    PartialEq,
-    SpecifiedValueInfo,
-    ToComputedValue,
-)]
+#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
 #[repr(C)]
 pub struct ScrollSnapAlign {
     block: ScrollSnapAlignKeyword,
     inline: ScrollSnapAlignKeyword,
 }
 
 impl ScrollSnapAlign {
     /// Returns `none`.
--- a/servo/components/style/values/specified/font.rs
+++ b/servo/components/style/values/specified/font.rs
@@ -12,17 +12,17 @@ use crate::values::computed::font::{Fami
 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, LengthPercentage};
-use crate::values::specified::{NoCalcLength, Number, NonNegativeNumber, Percentage};
+use crate::values::specified::{NoCalcLength, NonNegativeNumber, 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};
--- a/servo/components/style/values/specified/length.rs
+++ b/servo/components/style/values/specified/length.rs
@@ -6,21 +6,23 @@
 //!
 //! [length]: https://drafts.csswg.org/css-values/#lengths
 
 use super::{AllowQuirks, Number, Percentage, ToComputedValue};
 use crate::font_metrics::FontMetricsQueryResult;
 use crate::parser::{Parse, ParserContext};
 use crate::values::computed::{self, CSSPixelLength, Context};
 use crate::values::generics::length as generics;
-use crate::values::generics::length::{MaxSize as GenericMaxSize, Size as GenericSize, GenericLengthOrNumber};
+use crate::values::generics::length::{
+    GenericLengthOrNumber, MaxSize as GenericMaxSize, Size as GenericSize,
+};
 use crate::values::generics::transform::IsZeroLength;
 use crate::values::generics::NonNegative;
+use crate::values::specified::calc::CalcNode;
 use crate::values::specified::NonNegativeNumber;
-use crate::values::specified::calc::CalcNode;
 use crate::values::{Auto, CSSFloat, Either, 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};
--- a/servo/components/style/values/specified/mod.rs
+++ b/servo/components/style/values/specified/mod.rs
@@ -14,20 +14,20 @@ use super::generics::transform::IsParall
 use super::generics::{GreaterThanOrEqualToOne, NonNegative};
 use super::{Auto, CSSFloat, CSSInteger, Either};
 use crate::context::QuirksMode;
 use crate::parser::{Parse, ParserContext};
 use crate::values::serialize_atom_identifier;
 use crate::values::specified::calc::CalcNode;
 use crate::{Atom, Namespace, Prefix};
 use cssparser::{Parser, Token};
-use num_traits::{Zero, One};
+use num_traits::{One, Zero};
 use std::f32;
+use std::fmt::{self, Write};
 use std::ops::Add;
-use std::fmt::{self, Write};
 use style_traits::values::specified::AllowedNumericType;
 use style_traits::{CssWriter, ParseError, SpecifiedValueInfo, StyleParseErrorKind, ToCss};
 
 #[cfg(feature = "gecko")]
 pub use self::align::{AlignContent, AlignItems, AlignSelf, ContentDistribution};
 #[cfg(feature = "gecko")]
 pub use self::align::{JustifyContent, JustifyItems, JustifySelf, SelfAlignment};
 pub use self::angle::Angle;
--- a/servo/components/style/values/specified/svg.rs
+++ b/servo/components/style/values/specified/svg.rs
@@ -59,17 +59,17 @@ impl Parse for SVGStrokeDashArray {
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         if let Ok(values) = input.try(|i| {
             CommaWithSpace::parse(i, |i| {
                 NonNegativeSvgLengthPercentageOrNumber::parse(context, i)
             })
         }) {
-            return Ok(generic::SVGStrokeDashArray::Values(values))
+            return Ok(generic::SVGStrokeDashArray::Values(values));
         }
 
         try_match_ident_ignore_ascii_case! { input,
             "context-value" if generic::is_context_value_enabled(context) => {
                 Ok(generic::SVGStrokeDashArray::ContextValue)
             },
             "none" => Ok(generic::SVGStrokeDashArray::Values(vec![])),
         }
--- a/servo/components/style/values/specified/text.rs
+++ b/servo/components/style/values/specified/text.rs
@@ -9,19 +9,19 @@ use crate::properties::longhands::writin
 use crate::values::computed::text::LineHeight as ComputedLineHeight;
 use crate::values::computed::text::TextEmphasisKeywordValue as ComputedTextEmphasisKeywordValue;
 use crate::values::computed::text::TextEmphasisStyle as ComputedTextEmphasisStyle;
 use crate::values::computed::text::TextOverflow as ComputedTextOverflow;
 use crate::values::computed::{Context, ToComputedValue};
 use crate::values::generics::text::InitialLetter as GenericInitialLetter;
 use crate::values::generics::text::LineHeight as GenericLineHeight;
 use crate::values::generics::text::Spacing;
+use crate::values::specified::length::NonNegativeLengthPercentage;
 use crate::values::specified::length::{FontRelativeLength, Length};
 use crate::values::specified::length::{LengthPercentage, NoCalcLength};
-use crate::values::specified::length::{NonNegativeLengthPercentage};
 use crate::values::specified::{AllowQuirks, Integer, NonNegativeNumber, Number};
 use cssparser::{Parser, Token};
 use selectors::parser::SelectorParseErrorKind;
 use std::fmt::{self, Write};
 use style_traits::values::SequenceWriter;
 use style_traits::{CssWriter, KeywordsCollectFn, ParseError};
 use style_traits::{SpecifiedValueInfo, StyleParseErrorKind, ToCss};
 use unicode_segmentation::UnicodeSegmentation;
--- a/servo/components/style_derive/parse.rs
+++ b/servo/components/style_derive/parse.rs
@@ -65,22 +65,24 @@ fn parse_non_keyword_variant(
 
     parse
 }
 
 pub fn derive(mut input: DeriveInput) -> TokenStream {
     {
         let mut where_clause = input.generics.where_clause.take();
         for param in input.generics.type_params() {
-            cg::add_predicate(&mut where_clause, parse_quote!(#param: crate::parser::Parse));
+            cg::add_predicate(
+                &mut where_clause,
+                parse_quote!(#param: crate::parser::Parse),
+            );
         }
         input.generics.where_clause = where_clause;
     }
 
-
     let name = &input.ident;
     let s = Structure::new(&input);
 
     let mut saw_condition = false;
     let mut match_keywords = quote! {};
     let mut non_keywords = vec![];
 
     let mut effective_variants = 0;
@@ -135,23 +137,18 @@ pub fn derive(mut input: DeriveInput) ->
         quote! { _ }
     };
 
     let has_keywords = non_keywords.len() != effective_variants;
 
     let mut parse_non_keywords = quote! {};
     for (i, (variant, css_attrs, parse_attrs)) in non_keywords.iter().enumerate() {
         let skip_try = !has_keywords && i == non_keywords.len() - 1;
-        let parse_variant = parse_non_keyword_variant(
-            name,
-            variant,
-            css_attrs,
-            parse_attrs,
-            skip_try,
-        );
+        let parse_variant =
+            parse_non_keyword_variant(name, variant, css_attrs, parse_attrs, skip_try);
         parse_non_keywords.extend(parse_variant);
     }
 
     let parse_body = if needs_context {
         let parse_keywords = if has_keywords {
             quote! {
                 let location = input.current_source_location();
                 let ident = input.expect_ident()?;