style: Make tidy happy.

This commit is contained in:
Emilio Cobos Álvarez 2019-01-20 17:50:18 +01:00
parent 90c0ec0cf7
commit 289d9b033c
7 changed files with 14 additions and 10 deletions

View file

@ -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,

View file

@ -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]

View file

@ -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',

View file

@ -376,7 +376,8 @@ pub fn parse_border<'i, 't>(
) -> Result<Longhands, ParseError<'i>> {
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,

View file

@ -29,7 +29,8 @@ ${helpers.four_sides_shorthand("margin", "margin-%s", "specified::LengthPercenta
) -> Result<Longhands, ParseError<'i>> {
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,

View file

@ -28,7 +28,8 @@ ${helpers.four_sides_shorthand("padding", "padding-%s", "specified::NonNegativeL
) -> Result<Longhands, ParseError<'i>> {
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,

View file

@ -783,7 +783,8 @@
) -> Result<Longhands, ParseError<'i>> {
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,