mirror of
https://github.com/servo/servo.git
synced 2025-06-22 08:08:59 +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
|
/// Animated SVGPaint
|
||||||
pub type IntermediateSVGPaint = SVGPaint<AnimatedRGBA, ComputedUrl>;
|
pub type IntermediateSVGPaint = SVGPaint<AnimatedRGBA, ComputedUrl>;
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ impl Parse for Impossible {
|
||||||
/// A struct representing one of two kinds of values.
|
/// A struct representing one of two kinds of values.
|
||||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
#[derive(Animate, Clone, ComputeSquaredDistance, Copy, HasViewportPercentage)]
|
#[derive(Animate, Clone, ComputeSquaredDistance, Copy, HasViewportPercentage)]
|
||||||
#[derive(PartialEq, ToAnimatedValue, ToComputedValue, ToCss)]
|
#[derive(PartialEq, ToAnimatedValue, ToAnimatedZero, ToComputedValue, ToCss)]
|
||||||
pub enum Either<A, B> {
|
pub enum Either<A, B> {
|
||||||
/// The first value.
|
/// The first value.
|
||||||
First(A),
|
First(A),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue