Auto merge of #17774 - servo:derive-all-the-things, r=emilio

Prepare some code for future derivation 🌊

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17774)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-07-19 01:56:05 -07:00 committed by GitHub
commit d76d097891
18 changed files with 402 additions and 251 deletions

View file

@ -129,6 +129,8 @@
% if animation_value_type == "ComputedValue":
use properties::animated_properties::Animatable;
use values::animated::ToAnimatedZero;
impl Animatable for T {
fn add_weighted(&self, other: &Self, self_portion: f64, other_portion: f64)
-> Result<Self, ()> {
@ -149,6 +151,11 @@
self.0.compute_squared_distance(&other.0)
}
}
impl ToAnimatedZero for T {
#[inline]
fn to_animated_zero(&self) -> Result<Self, ()> { Err(()) }
}
% endif
pub type Iter<'a, 'cx, 'cx_a> = ComputedVecIter<'a, 'cx, 'cx_a, super::single_value::SpecifiedValue>;