Implement #[animate(fallback)] for #[derive(Animate)]

This allows us to derive the Animate trait, providing a fallback function
for when the 2 values aren't similar.
This commit is contained in:
Anthony Ramine 2017-08-26 16:25:28 +02:00
parent 3751fe9fdc
commit 4a4bf89575
7 changed files with 99 additions and 121 deletions

View file

@ -19,7 +19,7 @@ mod to_animated_zero;
mod to_computed_value;
mod to_css;
#[proc_macro_derive(Animate, attributes(animation))]
#[proc_macro_derive(Animate, attributes(animate, animation))]
pub fn derive_animate(stream: TokenStream) -> TokenStream {
let input = syn::parse_derive_input(&stream.to_string()).unwrap();
animate::derive(input).to_string().parse().unwrap()