diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2017-08-13 00:50:36 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2017-08-13 13:34:04 +0200 |
commit | 277351da3589ba6497635f12dc9793d032e469e1 (patch) | |
tree | b710b6cc38d4284d7cc848ff736445fc1a61a8d0 /components/style_derive/lib.rs | |
parent | 51b740033baaeb5fd4ce7ae1ad0b8dad3b3b7d9e (diff) | |
download | servo-277351da3589ba6497635f12dc9793d032e469e1.tar.gz servo-277351da3589ba6497635f12dc9793d032e469e1.zip |
Derive ComputeSquaredDistance
Diffstat (limited to 'components/style_derive/lib.rs')
-rw-r--r-- | components/style_derive/lib.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/components/style_derive/lib.rs b/components/style_derive/lib.rs index 683d6c2c563..13a855eb6ba 100644 --- a/components/style_derive/lib.rs +++ b/components/style_derive/lib.rs @@ -9,11 +9,18 @@ extern crate synstructure; use proc_macro::TokenStream; +mod compute_squared_distance; mod has_viewport_percentage; mod to_animated_value; mod to_computed_value; mod to_css; +#[proc_macro_derive(ComputeSquaredDistance)] +pub fn derive_compute_squared_distance(stream: TokenStream) -> TokenStream { + let input = syn::parse_derive_input(&stream.to_string()).unwrap(); + compute_squared_distance::derive(input).to_string().parse().unwrap() +} + #[proc_macro_derive(HasViewportPercentage)] pub fn derive_has_viewport_percentage(stream: TokenStream) -> TokenStream { let input = syn::parse_derive_input(&stream.to_string()).unwrap(); |