mirror of
https://github.com/servo/servo.git
synced 2025-06-21 23:59:00 +01:00
Derive ToAnimatedZero for Either<A, B>
This commit is contained in:
parent
4743696189
commit
49a5ceca9b
2 changed files with 1 additions and 19 deletions
|
@ -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>;
|
||||
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue