From 49a5ceca9b94acea2ac7837ae67880b928c8cc6c Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Thu, 24 Aug 2017 00:48:42 +0200 Subject: [PATCH] Derive ToAnimatedZero for Either --- .../helpers/animated_properties.mako.rs | 18 ------------------ components/style/values/mod.rs | 2 +- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index f0c65e018d7..02a60d209b1 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -2459,24 +2459,6 @@ impl ToAnimatedZero for TransformList { } } -impl ToAnimatedZero for Either -where - A: ToAnimatedZero, - B: ToAnimatedZero, -{ - #[inline] - fn to_animated_zero(&self) -> Result { - match *self { - Either::First(ref first) => { - Ok(Either::First(first.to_animated_zero()?)) - }, - Either::Second(ref second) => { - Ok(Either::Second(second.to_animated_zero()?)) - }, - } - } -} - /// Animated SVGPaint pub type IntermediateSVGPaint = SVGPaint; diff --git a/components/style/values/mod.rs b/components/style/values/mod.rs index 46a520400a0..6c54e434808 100644 --- a/components/style/values/mod.rs +++ b/components/style/values/mod.rs @@ -69,7 +69,7 @@ impl Parse for Impossible { /// A struct representing one of two kinds of values. #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[derive(Animate, Clone, ComputeSquaredDistance, Copy, HasViewportPercentage)] -#[derive(PartialEq, ToAnimatedValue, ToComputedValue, ToCss)] +#[derive(PartialEq, ToAnimatedValue, ToAnimatedZero, ToComputedValue, ToCss)] pub enum Either { /// The first value. First(A),