From dc7c1c62706d56d9e83c1edc665b95abd93181b8 Mon Sep 17 00:00:00 2001 From: Ravi Shankar Date: Mon, 21 Nov 2016 23:34:50 +0530 Subject: [PATCH] Some impls for Either --- components/style/values/specified/length.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/components/style/values/specified/length.rs b/components/style/values/specified/length.rs index 26eb45e9201..1abc5e36c23 100644 --- a/components/style/values/specified/length.rs +++ b/components/style/values/specified/length.rs @@ -343,6 +343,13 @@ impl Parse for Length { } } +impl Either { + #[inline] + pub fn parse_non_negative_length(input: &mut Parser) -> Result, ()> { + Length::parse_internal(input, AllowedNumericType::NonNegative).map(Either::First) + } +} + #[derive(Clone, Debug)] pub struct CalcSumNode { pub products: Vec, @@ -946,13 +953,6 @@ impl Parse for LengthOrPercentageOrNone { pub type LengthOrNone = Either; -impl LengthOrNone { - #[inline] - pub fn parse_non_negative(input: &mut Parser) -> Result { - Length::parse_internal(input, AllowedNumericType::NonNegative).map(Either::First) - } -} - #[derive(Clone, PartialEq, Copy, Debug)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum LengthOrPercentageOrAutoOrContent {