From b14e68f91536c717c6b6bfa105df597bef04c3e7 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Sat, 12 Aug 2017 13:26:04 +0200 Subject: [PATCH] Remove impl_animatable_for_option_tuple --- components/style/properties/helpers.mako.rs | 57 --------------------- 1 file changed, 57 deletions(-) diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index 82eeb653e16..540007298d5 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -956,63 +956,6 @@ %> -/// Macro for defining Animatable trait for tuple struct which has Option, -/// e.g. struct T(pub Option). -<%def name="impl_animatable_for_option_tuple(value_for_none)"> - impl Animatable for T { - #[inline] - fn add_weighted(&self, other: &Self, self_portion: f64, other_portion: f64) - -> Result { - match (self, other) { - (&T(Some(ref this)), &T(Some(ref other))) => { - Ok(T(this.add_weighted(other, self_portion, other_portion).ok())) - }, - (&T(Some(ref this)), &T(None)) => { - Ok(T(this.add_weighted(&${value_for_none}, self_portion, other_portion).ok())) - }, - (&T(None), &T(Some(ref other))) => { - Ok(T(${value_for_none}.add_weighted(other, self_portion, other_portion).ok())) - }, - (&T(None), &T(None)) => { - Ok(T(None)) - }, - } - } - - #[inline] - fn compute_distance(&self, other: &Self) -> Result { - match (self, other) { - (&T(Some(ref this)), &T(Some(ref other))) => { - this.compute_distance(other) - }, - (&T(Some(ref value)), &T(None)) | - (&T(None), &T(Some(ref value)))=> { - value.compute_distance(&${value_for_none}) - }, - (&T(None), &T(None)) => { - Ok(0.0) - }, - } - } - - #[inline] - fn compute_squared_distance(&self, other: &Self) -> Result { - match (self, other) { - (&T(Some(ref this)), &T(Some(ref other))) => { - this.compute_squared_distance(other) - }, - (&T(Some(ref value)), &T(None)) | - (&T(None), &T(Some(ref value))) => { - value.compute_squared_distance(&${value_for_none}) - }, - (&T(None), &T(None)) => { - Ok(0.0) - }, - } - } - } - - // Define property that supports prefixed intrinsic size keyword values for gecko. // E.g. -moz-max-content, -moz-min-content, etc. <%def name="gecko_size_type(name, length_type, initial_value, logical, **kwargs)">