Bug 1371480 - Return zero when computing distance of Option with both value is none. r?birtles
MozReview-Commit-ID: 80uFiC6JkJp
--- a/servo/components/style/properties/helpers/animated_properties.mako.rs
+++ b/servo/components/style/properties/helpers/animated_properties.mako.rs
@@ -848,16 +848,17 @@ impl <T> Animatable for Option<T>
}
#[inline]
fn compute_squared_distance(&self, other: &Self) -> Result<f64, ()> {
match (self, other) {
(&Some(ref this), &Some(ref other)) => {
this.compute_squared_distance(other)
},
+ (&None, &None) => Ok(0.0),
_ => Err(()),
}
}
}
/// https://drafts.csswg.org/css-transitions/#animtype-number
impl Animatable for f32 {
#[inline]