From 1a01a5ae190ad02e44c3550ac0336b1f0983be51 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 30 Apr 2021 11:55:59 +0300 Subject: internal: fix naming polarity Type Constructors have *parameters*, when they are substituted with type *arguments*, we have a type. --- crates/ide_assists/src/handlers/extract_function.rs | 2 +- crates/ide_assists/src/utils/suggest_name.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ide_assists/src') diff --git a/crates/ide_assists/src/handlers/extract_function.rs b/crates/ide_assists/src/handlers/extract_function.rs index 5f80a40c8..b30652a9d 100644 --- a/crates/ide_assists/src/handlers/extract_function.rs +++ b/crates/ide_assists/src/handlers/extract_function.rs @@ -1183,7 +1183,7 @@ fn make_ret_ty(ctx: &AssistContext, module: hir::Module, fun: &Function) -> Opti } FlowHandler::Try { kind: TryKind::Result { ty: parent_ret_ty } } => { let handler_ty = parent_ret_ty - .type_parameters() + .type_arguments() .nth(1) .map(|ty| make_ty(&ty, ctx, module)) .unwrap_or_else(make::ty_unit); diff --git a/crates/ide_assists/src/utils/suggest_name.rs b/crates/ide_assists/src/utils/suggest_name.rs index 533624c1f..deafcd630 100644 --- a/crates/ide_assists/src/utils/suggest_name.rs +++ b/crates/ide_assists/src/utils/suggest_name.rs @@ -227,7 +227,7 @@ fn name_of_type(ty: &hir::Type, db: &RootDatabase) -> Option { let name = adt.name(db).to_string(); if WRAPPER_TYPES.contains(&name.as_str()) { - let inner_ty = ty.type_parameters().next()?; + let inner_ty = ty.type_arguments().next()?; return name_of_type(&inner_ty, db); } -- cgit v1.2.3