Derive ToAnimatedZero for Either<A, B>

This commit is contained in:
Anthony Ramine 2017-08-24 00:48:42 +02:00
parent 4743696189
commit 49a5ceca9b
2 changed files with 1 additions and 19 deletions

View file

@ -2459,24 +2459,6 @@ impl ToAnimatedZero for TransformList {
}
}
impl<A, B> ToAnimatedZero for Either<A, B>
where
A: ToAnimatedZero,
B: ToAnimatedZero,
{
#[inline]
fn to_animated_zero(&self) -> Result<Self, ()> {
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<AnimatedRGBA, ComputedUrl>;

View file

@ -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<A, B> {
/// The first value.
First(A),