diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2017-08-25 19:58:49 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2017-08-27 23:31:16 +0200 |
commit | 04ad28b564ca34f4c326bca9a0409ec00f61230f (patch) | |
tree | 764feca3e72cbd87dbe279fa14581d901b4ba446 /components/style_derive/to_css.rs | |
parent | 13d47ba69a233739cf653b293466e429e94665b4 (diff) | |
download | servo-04ad28b564ca34f4c326bca9a0409ec00f61230f.tar.gz servo-04ad28b564ca34f4c326bca9a0409ec00f61230f.zip |
Refactor how we handle trait bounds in style_derive
For the traits we derive which methods don't depend on associated types (i.e.
all of them but ToAnimatedValue and ToComputedValue), we now add trait bounds
for the actual field types directly, instead of bounding the type parameters.
Diffstat (limited to 'components/style_derive/to_css.rs')
-rw-r--r-- | components/style_derive/to_css.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/components/style_derive/to_css.rs b/components/style_derive/to_css.rs index 444c42e37da..6dd7567a5fb 100644 --- a/components/style_derive/to_css.rs +++ b/components/style_derive/to_css.rs @@ -21,11 +21,7 @@ pub fn derive(input: syn::DeriveInput) -> quote::Tokens { let mut expr = if !bindings.is_empty() { let mut expr = quote! {}; for binding in bindings { - if cg::is_parameterized(&binding.field.ty, &input.generics.ty_params) { - where_clause.predicates.push( - cg::where_predicate(binding.field.ty.clone(), trait_path), - ); - } + where_clause.add_trait_bound(binding.field.ty.clone()); expr = quote! { #expr writer.item(#binding)?; |