From f10e4857406405e4b020eb8a9e185f83fe52f416 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Mon, 26 Feb 2018 15:18:43 +0100 Subject: [PATCH] Remove 2 unused type aliases --- components/style/values/computed/mod.rs | 6 ------ components/style/values/specified/mod.rs | 6 ------ tests/unit/style/parsing/length.rs | 7 ------- 3 files changed, 19 deletions(-) diff --git a/components/style/values/computed/mod.rs b/components/style/values/computed/mod.rs index 36d70e7ea3e..ebbb7af6b5c 100644 --- a/components/style/values/computed/mod.rs +++ b/components/style/values/computed/mod.rs @@ -550,12 +550,6 @@ impl From for PositiveInteger { } } -/// | | -pub type LengthOrPercentageOrNumber = Either; - -/// NonNegativeLengthOrPercentage | NonNegativeNumber -pub type NonNegativeLengthOrPercentageOrNumber = Either; - #[allow(missing_docs)] #[cfg_attr(feature = "servo", derive(MallocSizeOf))] #[derive(Clone, ComputeSquaredDistance, Copy, Debug, PartialEq)] diff --git a/components/style/values/specified/mod.rs b/components/style/values/specified/mod.rs index b0c0c1cffba..5ea811a5c95 100644 --- a/components/style/values/specified/mod.rs +++ b/components/style/values/specified/mod.rs @@ -550,12 +550,6 @@ pub type GridLine = GenericGridLine; /// ` | ` pub type GridTemplateComponent = GenericGridTemplateComponent; -/// | | -pub type LengthOrPercentageOrNumber = Either; - -/// NonNegativeLengthOrPercentage | NonNegativeNumber -pub type NonNegativeLengthOrPercentageOrNumber = Either; - #[derive(Clone, Debug, MallocSizeOf, PartialEq)] /// rect(, , , ) used by clip and image-region pub struct ClipRect { diff --git a/tests/unit/style/parsing/length.rs b/tests/unit/style/parsing/length.rs index 7b691311ebd..0d506926ad8 100644 --- a/tests/unit/style/parsing/length.rs +++ b/tests/unit/style/parsing/length.rs @@ -7,8 +7,6 @@ use parsing::parse; use style::context::QuirksMode; use style::parser::{Parse, ParserContext}; use style::stylesheets::{CssRuleType, Origin}; -use style::values::Either; -use style::values::specified::{LengthOrPercentageOrNumber, Number}; use style::values::specified::length::{AbsoluteLength, Length, NoCalcLength}; use style_traits::{ParsingMode, ToCss}; @@ -49,8 +47,3 @@ fn test_parsing_modes() { assert!(result.is_ok()); assert_eq!(result.unwrap(), Length::NoCalc(NoCalcLength::Absolute(AbsoluteLength::Px(1.)))); } - -#[test] -fn test_zero_percentage_length_or_number() { - assert_eq!(parse(LengthOrPercentageOrNumber::parse, "0"), Ok(Either::First(Number::new(0.)))); -}