mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Improve handling of trait bounds when deriving fmap-like traits
This commit is contained in:
parent
8101887d31
commit
efc852f6e3
12 changed files with 229 additions and 136 deletions
|
@ -30,7 +30,7 @@ pub fn derive(input: syn::DeriveInput) -> quote::Tokens {
|
|||
} else {
|
||||
let mut sum = quote!();
|
||||
sum.append_separated(this_info.iter().zip(&other_info).map(|(this, other)| {
|
||||
where_clause.add_trait_bound(this.field.ty.clone());
|
||||
where_clause.add_trait_bound(&this.field.ty);
|
||||
quote! {
|
||||
::values::distance::ComputeSquaredDistance::compute_squared_distance(#this, #other)?
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue