fn fn_args(
    ctx: &AssistCtx,
    call: &ast::CallExpr,
) -> Option<(Option<ast::TypeParamList>, ast::ParamList)> {
    let mut arg_names = Vec::new();
    let mut arg_types = Vec::new();
    for arg in call.arg_list()?.args() {
        let arg_name = match fn_arg_name(&arg) {
            Some(name) => name,
            None => String::from("arg"),
        };
        arg_names.push(arg_name);
        arg_types.push(match fn_arg_type(ctx, &arg) {
            Some(ty) => ty,
            None => String::from("()"),
        });
    }
    deduplicate_arg_names(&mut arg_names);
    let params = arg_names.into_iter().zip(arg_types).map(|(name, ty)| ast::make::param(name, ty));
    Some((None, ast::make::param_list(params)))
}
/// Computes the type variables and arguments required for the generated function
Computes the type variables and arguments required for the generated function
Computes the type variables and arguments required for the generated function
fn fn_args(
    ctx: &AssistCtx,
    call: &ast::CallExpr,
) -> Option<(Option<ast::TypeParamList>, ast::ParamList)> {
    let mut arg_names = Vec::new();
    let mut arg_types = Vec::new();
    for arg in call.arg_list()?.args() {
        let arg_name = match fn_arg_name(&arg) {
            Some(name) => name,
            None => String::from("arg"),
        };
        arg_names.push(arg_name);
        arg_types.push(match fn_arg_type(ctx, &arg) {
            Some(ty) => ty,
            None => String::from("()"),
        });
    }
    deduplicate_arg_names(&mut arg_names);
    let params = arg_names.into_iter().zip(arg_types).map(|(name, ty)| ast::make::param(name, ty));
    Some((None, ast::make::param_list(params)))
}
fn fn_args ( ctx : & AssistCtx , call : & ast :: CallExpr , ) -> Option < ( Option < ast :: TypeParamList > , ast :: ParamList ) > { let mut arg_names = Vec :: new ( ) ; let mut arg_types = Vec :: new ( ) ; for arg in call . arg_list ( ) ? . args ( ) { let arg_name = match fn_arg_name ( & arg ) { Some ( name ) => name , None => String :: from ( " " ) , } ; arg_names . push ( arg_name ) ; arg_types . push ( match fn_arg_type ( ctx , & arg ) { Some ( ty ) => ty , None => String :: from ( " " ) , } ) ; } deduplicate_arg_names ( & mut arg_names ) ; let params = arg_names . into_iter ( ) . zip ( arg_types ) . map ( | ( name , ty ) | ast :: make :: param ( name , ty ) ) ; Some ( ( None , ast :: make :: param_list ( params ) ) ) }
Computes the type variables and arguments required for the generated function
Computes the type variables and arguments required for the generated function
ctx
&AssistCtx
call
&ast::CallExpr
ctx
&AssistCtx
call
&ast::CallExpr