style: Part 1: Support field_bound on Animate.

So we can derive Animate on more generic types.

Differential Revision: https://phabricator.services.mozilla.com/D16339
This commit is contained in:
Boris Chiou 2019-01-12 02:19:04 +00:00 committed by Emilio Cobos Álvarez
parent 7efbd9cde6
commit a8943d2ec5
2 changed files with 29 additions and 17 deletions

View file

@ -113,7 +113,8 @@ pub fn animate_multiplicative_factor(
/// function has been specified through `#[animate(fallback)]`.
///
/// Trait bounds for type parameter `Foo` can be opted out of with
/// `#[animation(no_bound(Foo))]` on the type definition.
/// `#[animation(no_bound(Foo))]` on the type definition, trait bounds for
/// fields can be opted into with `#[animation(field_bound)]` on the field.
pub trait Animate: Sized {
/// Animate a value towards another one, given an animation procedure.
fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()>;