mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Kill fmap_output_type
This commit is contained in:
parent
4d0bf2ddf9
commit
68be1aae8c
1 changed files with 2 additions and 15 deletions
|
@ -54,8 +54,7 @@ impl<'input, 'path> WhereClause<'input, 'path> {
|
|||
}
|
||||
|
||||
let output_type = map_type_params(ty, &self.params, &mut |ident| {
|
||||
let ty = Type::Path(syn::TypePath { qself: None, path: ident.clone().into() });
|
||||
fmap_output_type(ty, trait_path, output)
|
||||
parse_quote!(<#ident as ::#trait_path>::#output)
|
||||
});
|
||||
|
||||
let pred = where_predicate(
|
||||
|
@ -111,14 +110,6 @@ where
|
|||
})
|
||||
}
|
||||
|
||||
pub fn fmap_output_type(
|
||||
ty: Type,
|
||||
trait_path: &Path,
|
||||
trait_output: Ident,
|
||||
) -> Type {
|
||||
parse_quote!(<#ty as ::#trait_path>::#trait_output)
|
||||
}
|
||||
|
||||
pub fn fmap_trait_output(
|
||||
input: &DeriveInput,
|
||||
trait_path: &Path,
|
||||
|
@ -133,11 +124,7 @@ pub fn fmap_trait_output(
|
|||
&GenericParam::Type(ref data) => {
|
||||
let ident = data.ident;
|
||||
GenericArgument::Type(
|
||||
fmap_output_type(
|
||||
parse_quote!(#ident),
|
||||
trait_path,
|
||||
trait_output
|
||||
)
|
||||
parse_quote!(<#ident as ::#trait_path>::#trait_output),
|
||||
)
|
||||
},
|
||||
ref arg => panic!("arguments {:?} cannot be mapped yet", arg)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue