diff --git a/components/embedder_traits/lib.rs b/components/embedder_traits/lib.rs index fbf1102dec3..bfb27235af1 100644 --- a/components/embedder_traits/lib.rs +++ b/components/embedder_traits/lib.rs @@ -24,7 +24,7 @@ use webrender_api::{DeviceIntPoint, DeviceIntSize}; /// A cursor for the window. This is different from a CSS cursor (see /// `CursorKind`) in that it has no `Auto` value. #[repr(u8)] -#[derive(Copy, Clone, FromPrimitive, PartialEq, Eq, Deserialize, Serialize)] +#[derive(Clone, Copy, Deserialize, Eq, FromPrimitive, PartialEq, Serialize)] pub enum Cursor { None, Default, diff --git a/components/style/properties/data.py b/components/style/properties/data.py index 39b5743f4a9..b897cc140d2 100644 --- a/components/style/properties/data.py +++ b/components/style/properties/data.py @@ -247,9 +247,9 @@ class Longhand(object): assert not logical_side logical_side = s assert logical_side - physical = PHYSICAL_SIDES if logical_side in LOGICAL_SIDES else \ - PHYSICAL_SIZES if logical_side in LOGICAL_SIZES else \ - LOGICAL_CORNERS + physical = PHYSICAL_SIDES if logical_side in LOGICAL_SIDES \ + else PHYSICAL_SIZES if logical_side in LOGICAL_SIZES \ + else LOGICAL_CORNERS return [self.name.replace(logical_side, physical_side).replace("inset-", "") for physical_side in physical] diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index 2139ff2be71..3cbc5a2a33d 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -3,8 +3,8 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ <%! - from data import Keyword, to_rust_ident, to_camel_case - from data import LOGICAL_CORNERS, PHYSICAL_CORNERS, LOGICAL_SIDES, PHYSICAL_SIDES, LOGICAL_SIZES, SYSTEM_FONT_LONGHANDS + from data import Keyword, to_rust_ident, to_camel_case, SYSTEM_FONT_LONGHANDS + from data import LOGICAL_CORNERS, PHYSICAL_CORNERS, LOGICAL_SIDES, PHYSICAL_SIDES, LOGICAL_SIZES %> <%def name="predefined_type(name, type, initial_value, parse_method='parse', diff --git a/components/style/properties/shorthands/border.mako.rs b/components/style/properties/shorthands/border.mako.rs index 255464892a4..cd472068793 100644 --- a/components/style/properties/shorthands/border.mako.rs +++ b/components/style/properties/shorthands/border.mako.rs @@ -376,7 +376,8 @@ pub fn parse_border<'i, 't>( ) -> Result> { let start_value = border_${axis}_start_${prop}::parse(context, input)?; let end_value = - input.try(|input| border_${axis}_start_${prop}::parse(context, input)).unwrap_or_else(|_| start_value.clone()); + input.try(|input| border_${axis}_start_${prop}::parse(context, input)) + .unwrap_or_else(|_| start_value.clone()); Ok(expanded! { border_${axis}_start_${prop}: start_value, diff --git a/components/style/properties/shorthands/margin.mako.rs b/components/style/properties/shorthands/margin.mako.rs index 4e74427cd13..2eb920700e3 100644 --- a/components/style/properties/shorthands/margin.mako.rs +++ b/components/style/properties/shorthands/margin.mako.rs @@ -29,7 +29,8 @@ ${helpers.four_sides_shorthand("margin", "margin-%s", "specified::LengthPercenta ) -> Result> { let start_value = LengthPercentageOrAuto::parse(context, input)?; let end_value = - input.try(|input| LengthPercentageOrAuto::parse(context, input)).unwrap_or_else(|_| start_value.clone()); + input.try(|input| LengthPercentageOrAuto::parse(context, input)) + .unwrap_or_else(|_| start_value.clone()); Ok(expanded! { margin_${axis}_start: start_value, diff --git a/components/style/properties/shorthands/padding.mako.rs b/components/style/properties/shorthands/padding.mako.rs index cf96c56d293..5749029aa20 100644 --- a/components/style/properties/shorthands/padding.mako.rs +++ b/components/style/properties/shorthands/padding.mako.rs @@ -28,7 +28,8 @@ ${helpers.four_sides_shorthand("padding", "padding-%s", "specified::NonNegativeL ) -> Result> { let start_value = NonNegativeLengthPercentage::parse(context, input)?; let end_value = - input.try(|input| NonNegativeLengthPercentage::parse(context, input)).unwrap_or_else(|_| start_value.clone()); + input.try(|input| NonNegativeLengthPercentage::parse(context, input)) + .unwrap_or_else(|_| start_value.clone()); Ok(expanded! { padding_${axis}_start: start_value, diff --git a/components/style/properties/shorthands/position.mako.rs b/components/style/properties/shorthands/position.mako.rs index 4b2dfd1ea32..561affe952c 100644 --- a/components/style/properties/shorthands/position.mako.rs +++ b/components/style/properties/shorthands/position.mako.rs @@ -783,7 +783,8 @@ ) -> Result> { let start_value = LengthPercentageOrAuto::parse(context, input)?; let end_value = - input.try(|input| LengthPercentageOrAuto::parse(context, input)).unwrap_or_else(|_| start_value.clone()); + input.try(|input| LengthPercentageOrAuto::parse(context, input)) + .unwrap_or_else(|_| start_value.clone()); Ok(expanded! { inset_${axis}_start: start_value,