pub fn replace_signature_types(decl: P<ast::FnDecl>, new_ty: P<ast::Ty>) -> P<ast::FnDecl> {
    P(ast::FnDecl {
        output: match decl.output {
            ast::FunctionRetTy::Default(sp) => ast::FunctionRetTy::Default(sp),
            ast::FunctionRetTy::Ty(..) => ast::FunctionRetTy::Ty(new_ty.clone()),
        },
        variadic: decl.variadic,
        inputs: decl.inputs.iter().map(|arg| {
            if arg.is_self() {
                arg.clone() // leave untouched
            } else {
                ast::Arg {
                    ty: new_ty.clone(),
                    ..arg.clone()
                }
            }
        }).collect()
    })
}
/// Replaces all parameter types in a function declaration.
Replaces all parameter types in a function declaration.
Replaces all parameter types in a function declaration .
pub fn replace_signature_types(decl: P<ast::FnDecl>, new_ty: P<ast::Ty>) -> P<ast::FnDecl> {
    P(ast::FnDecl {
        output: match decl.output {
            ast::FunctionRetTy::Default(sp) => ast::FunctionRetTy::Default(sp),
            ast::FunctionRetTy::Ty(..) => ast::FunctionRetTy::Ty(new_ty.clone()),
        },
        variadic: decl.variadic,
        inputs: decl.inputs.iter().map(|arg| {
            if arg.is_self() {
                arg.clone() // leave untouched
            } else {
                ast::Arg {
                    ty: new_ty.clone(),
                    ..arg.clone()
                }
            }
        }).collect()
    })
}
pub fn replace_signature_types ( decl : P < ast :: FnDecl > , new_ty : P < ast :: Ty > ) -> P < ast :: FnDecl > { P ( ast :: FnDecl { output : match decl . output { ast :: FunctionRetTy :: Default ( sp ) => ast :: FunctionRetTy :: Default ( sp ) , ast :: FunctionRetTy :: Ty ( .. ) => ast :: FunctionRetTy :: Ty ( new_ty . clone ( ) ) , } , variadic : decl . variadic , inputs : decl . inputs . iter ( ) . map ( | arg | { if arg . is_self ( ) { arg . clone ( ) // leave untouched } else { ast :: Arg { ty : new_ty . clone ( ) , .. arg . clone ( ) } } } ) . collect ( ) } ) }
Replaces all parameter types in a function declaration.
Replaces all parameter types in a function declaration .
decl
P<ast::FnDecl>
new_ty
P<ast::Ty>
decl
P<ast::FnDecl>
new_ty
P<ast::Ty>