Derive the most trivial Animate impls

This commit is contained in:
Anthony Ramine 2017-08-22 18:45:30 +02:00
parent faaf31411a
commit 7ee124b1ed
20 changed files with 168 additions and 314 deletions

View file

@ -9,6 +9,7 @@ extern crate synstructure;
use proc_macro::TokenStream;
mod animate;
mod compute_squared_distance;
mod has_viewport_percentage;
mod to_animated_value;
@ -16,6 +17,12 @@ mod to_animated_zero;
mod to_computed_value;
mod to_css;
#[proc_macro_derive(Animate)]
pub fn derive_animate(stream: TokenStream) -> TokenStream {
let input = syn::parse_derive_input(&stream.to_string()).unwrap();
animate::derive(input).to_string().parse().unwrap()
}
#[proc_macro_derive(ComputeSquaredDistance)]
pub fn derive_compute_squared_distance(stream: TokenStream) -> TokenStream {
let input = syn::parse_derive_input(&stream.to_string()).unwrap();