Support #[animation(error)] in more cases

The trait ToAnimatedZero now supports it, and it now applies to things with generics,
avoiding the trait bounds for field types of the variant on which it applies.
This commit is contained in:
Anthony Ramine 2017-08-25 22:40:24 +02:00
parent dc827c14e1
commit af560a8fab
4 changed files with 31 additions and 90 deletions

View file

@ -43,7 +43,7 @@ pub fn derive_to_animated_value(stream: TokenStream) -> TokenStream {
to_animated_value::derive(input).to_string().parse().unwrap()
}
#[proc_macro_derive(ToAnimatedZero)]
#[proc_macro_derive(ToAnimatedZero, attributes(animation))]
pub fn derive_to_animated_zero(stream: TokenStream) -> TokenStream {
let input = syn::parse_derive_input(&stream.to_string()).unwrap();
to_animated_zero::derive(input).to_string().parse().unwrap()