style: Share more code between ToAnimatedValue and ToComputedValue derive.

I'm going to add a ToResolvedValue, and I don't want to add more copy-pasta.

This shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D26289
This commit is contained in:
Emilio Cobos Álvarez 2019-04-09 09:37:26 +00:00
parent ae32e4df40
commit c3ab3f0963
3 changed files with 124 additions and 103 deletions

View file

@ -32,8 +32,8 @@ use synstructure::{self, BindStyle, BindingInfo, VariantAst, VariantInfo};
pub fn propagate_clauses_to_output_type(
where_clause: &mut Option<syn::WhereClause>,
generics: &syn::Generics,
trait_path: Path,
trait_output: Ident,
trait_path: &Path,
trait_output: &Ident,
) {
let where_clause = match *where_clause {
Some(ref mut clause) => clause,
@ -104,7 +104,7 @@ where
})
}
pub fn fmap_trait_output(input: &DeriveInput, trait_path: &Path, trait_output: Ident) -> Path {
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 {