diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-30 09:57:17 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-30 09:57:17 +0100 |
commit | 6ea91a419f89e2486938d139daf8eb8620444944 (patch) | |
tree | 82e7ad6968979da2c101d878c459618f1209cda2 /crates/ide_assists | |
parent | 80bee14e14f67f02746befff77a8a4bbfd3e5849 (diff) | |
parent | 1a01a5ae190ad02e44c3550ac0336b1f0983be51 (diff) |
Merge #8695
8695: internal: fix naming polarity r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ide_assists')
-rw-r--r-- | crates/ide_assists/src/handlers/extract_function.rs | 2 | ||||
-rw-r--r-- | crates/ide_assists/src/handlers/generate_from_impl_for_enum.rs | 2 | ||||
-rw-r--r-- | crates/ide_assists/src/utils/suggest_name.rs | 2 |
3 files changed, 3 insertions, 3 deletions
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 | |||
1183 | } | 1183 | } |
1184 | FlowHandler::Try { kind: TryKind::Result { ty: parent_ret_ty } } => { | 1184 | FlowHandler::Try { kind: TryKind::Result { ty: parent_ret_ty } } => { |
1185 | let handler_ty = parent_ret_ty | 1185 | let handler_ty = parent_ret_ty |
1186 | .type_parameters() | 1186 | .type_arguments() |
1187 | .nth(1) | 1187 | .nth(1) |
1188 | .map(|ty| make_ty(&ty, ctx, module)) | 1188 | .map(|ty| make_ty(&ty, ctx, module)) |
1189 | .unwrap_or_else(make::ty_unit); | 1189 | .unwrap_or_else(make::ty_unit); |
diff --git a/crates/ide_assists/src/handlers/generate_from_impl_for_enum.rs b/crates/ide_assists/src/handlers/generate_from_impl_for_enum.rs index c13c6eebe..ce6998d82 100644 --- a/crates/ide_assists/src/handlers/generate_from_impl_for_enum.rs +++ b/crates/ide_assists/src/handlers/generate_from_impl_for_enum.rs | |||
@@ -91,7 +91,7 @@ fn existing_from_impl( | |||
91 | 91 | ||
92 | let enum_type = enum_.ty(sema.db); | 92 | let enum_type = enum_.ty(sema.db); |
93 | 93 | ||
94 | let wrapped_type = variant.fields(sema.db).get(0)?.signature_ty(sema.db); | 94 | let wrapped_type = variant.fields(sema.db).get(0)?.ty(sema.db); |
95 | 95 | ||
96 | if enum_type.impls_trait(sema.db, from_trait, &[wrapped_type]) { | 96 | if enum_type.impls_trait(sema.db, from_trait, &[wrapped_type]) { |
97 | Some(()) | 97 | Some(()) |
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<String> { | |||
227 | let name = adt.name(db).to_string(); | 227 | let name = adt.name(db).to_string(); |
228 | 228 | ||
229 | if WRAPPER_TYPES.contains(&name.as_str()) { | 229 | if WRAPPER_TYPES.contains(&name.as_str()) { |
230 | let inner_ty = ty.type_parameters().next()?; | 230 | let inner_ty = ty.type_arguments().next()?; |
231 | return name_of_type(&inner_ty, db); | 231 | return name_of_type(&inner_ty, db); |
232 | } | 232 | } |
233 | 233 | ||