mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Derive the most trivial Animate impls
This commit is contained in:
parent
faaf31411a
commit
7ee124b1ed
20 changed files with 168 additions and 314 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue