mirror of
https://github.com/servo/servo.git
synced 2025-08-14 01:45:33 +01:00
Simplify the derived bounds for ToAnimatedValue
This commit is contained in:
parent
664efab4a3
commit
92068ca540
2 changed files with 29 additions and 9 deletions
|
@ -126,7 +126,16 @@ pub fn fmap_trait_parts<'input, 'path>(
|
|||
) -> (ImplGenerics<'input>, TypeGenerics<'input>, WhereClause<'input, 'path>, Path) {
|
||||
let (impl_generics, ty_generics, mut where_clause) = trait_parts(input, trait_path);
|
||||
where_clause.trait_output = Some(trait_output);
|
||||
let output_ty = PathSegment {
|
||||
let output_ty = fmap_trait_output(input, trait_path, trait_output);
|
||||
(impl_generics, ty_generics, where_clause, output_ty)
|
||||
}
|
||||
|
||||
pub fn fmap_trait_output(
|
||||
input: &DeriveInput,
|
||||
trait_path: &Path,
|
||||
trait_output: Ident,
|
||||
) -> Path {
|
||||
let segment = PathSegment {
|
||||
ident: input.ident.clone(),
|
||||
arguments: PathArguments::AngleBracketed(AngleBracketedGenericArguments {
|
||||
args: input.generics.params.iter().map(|arg| {
|
||||
|
@ -151,7 +160,7 @@ pub fn fmap_trait_parts<'input, 'path>(
|
|||
|
||||
})
|
||||
};
|
||||
(impl_generics, ty_generics, where_clause, output_ty.into())
|
||||
segment.into()
|
||||
}
|
||||
|
||||
pub fn is_parameterized(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue