Don't generate fancy Clone + PartialEq bounds for #[animation(constant)]

This commit is contained in:
Anthony Ramine 2018-03-09 10:31:20 +01:00
parent e82d0c20a6
commit c2e4a609a0

View file

@ -71,24 +71,6 @@ fn derive_variant_arm(
computations.append_all(iter.map(|(result, (this, other))| { computations.append_all(iter.map(|(result, (this, other))| {
let field_attrs = cg::parse_field_attrs::<AnimationFieldAttrs>(&result.ast()); let field_attrs = cg::parse_field_attrs::<AnimationFieldAttrs>(&result.ast());
if field_attrs.constant { if field_attrs.constant {
if cg::is_parameterized(&result.ast().ty, &where_clause.params, None) {
cg::add_predicate(
&mut where_clause.inner,
cg::where_predicate(
result.ast().ty.clone(),
&parse_quote!(std::cmp::PartialEq),
None,
),
);
cg::add_predicate(
&mut where_clause.inner,
cg::where_predicate(
result.ast().ty.clone(),
&parse_quote!(std::clone::Clone),
None,
),
);
}
quote! { quote! {
if #this != #other { if #this != #other {
return Err(()); return Err(());