diff options
author | Manish Goregaokar <manishsmail@gmail.com> | 2017-10-03 15:06:44 -0700 |
---|---|---|
committer | Manish Goregaokar <manishsmail@gmail.com> | 2017-11-02 14:29:58 -0700 |
commit | dcefcc3c225e92c397fe04b42c75c94e94092397 (patch) | |
tree | 43da0cd4409e9e645d6ab2eff79429201a0f04d6 /components/style_derive/to_computed_value.rs | |
parent | 337d48aa61bd705ea7bf162a6dc6cf49addb7cb8 (diff) | |
download | servo-dcefcc3c225e92c397fe04b42c75c94e94092397.tar.gz servo-dcefcc3c225e92c397fe04b42c75c94e94092397.zip |
Add ToComputedValue and ToCss impls
Diffstat (limited to 'components/style_derive/to_computed_value.rs')
-rw-r--r-- | components/style_derive/to_computed_value.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/components/style_derive/to_computed_value.rs b/components/style_derive/to_computed_value.rs index 7e4db276edd..c53b25408e9 100644 --- a/components/style_derive/to_computed_value.rs +++ b/components/style_derive/to_computed_value.rs @@ -25,7 +25,9 @@ pub fn derive(input: DeriveInput) -> Tokens { } quote! { ::std::clone::Clone::clone(#binding) } } else { - where_clause.add_trait_bound(&binding.field.ty); + if !attrs.ignore_bound { + where_clause.add_trait_bound(&binding.field.ty); + } quote! { ::values::computed::ToComputedValue::to_computed_value(#binding, context) } @@ -68,4 +70,5 @@ pub fn derive(input: DeriveInput) -> Tokens { #[derive(Default, FromField)] struct ComputedValueAttrs { clone: bool, + ignore_bound: bool, } |