diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-08-21 18:15:09 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-08-21 18:15:09 +0100 |
commit | aab5aaccf2b1af8f1820a244a2c293c7460f9eb6 (patch) | |
tree | 60f971e2be8341c7759defc6662f83d6c47d0fdd /crates/assists/src/handlers | |
parent | df54561a689a9eb7b1962b69a397a1221200c116 (diff) | |
parent | 95f33bb5f73a7f9b7922eef14b996c0a489a6404 (diff) |
Merge #5838
5838: :arrow_up: autocfg
r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/assists/src/handlers')
-rw-r--r-- | crates/assists/src/handlers/auto_import.rs | 2 | ||||
-rw-r--r-- | crates/assists/src/handlers/replace_unwrap_with_match.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/crates/assists/src/handlers/auto_import.rs b/crates/assists/src/handlers/auto_import.rs index b9ec3f10b..c4770f336 100644 --- a/crates/assists/src/handlers/auto_import.rs +++ b/crates/assists/src/handlers/auto_import.rs | |||
@@ -239,7 +239,7 @@ impl ImportCandidate { | |||
239 | return None; | 239 | return None; |
240 | } | 240 | } |
241 | Some(Self::TraitMethod( | 241 | Some(Self::TraitMethod( |
242 | sema.type_of_expr(&method_call.expr()?)?, | 242 | sema.type_of_expr(&method_call.receiver()?)?, |
243 | method_call.name_ref()?.syntax().to_string(), | 243 | method_call.name_ref()?.syntax().to_string(), |
244 | )) | 244 | )) |
245 | } | 245 | } |
diff --git a/crates/assists/src/handlers/replace_unwrap_with_match.rs b/crates/assists/src/handlers/replace_unwrap_with_match.rs index 9705f11b7..4043c219c 100644 --- a/crates/assists/src/handlers/replace_unwrap_with_match.rs +++ b/crates/assists/src/handlers/replace_unwrap_with_match.rs | |||
@@ -42,7 +42,7 @@ pub(crate) fn replace_unwrap_with_match(acc: &mut Assists, ctx: &AssistContext) | |||
42 | if name.text() != "unwrap" { | 42 | if name.text() != "unwrap" { |
43 | return None; | 43 | return None; |
44 | } | 44 | } |
45 | let caller = method_call.expr()?; | 45 | let caller = method_call.receiver()?; |
46 | let ty = ctx.sema.type_of_expr(&caller)?; | 46 | let ty = ctx.sema.type_of_expr(&caller)?; |
47 | let happy_variant = TryEnum::from_ty(&ctx.sema, &ty)?.happy_case(); | 47 | let happy_variant = TryEnum::from_ty(&ctx.sema, &ty)?.happy_case(); |
48 | let target = method_call.syntax().text_range(); | 48 | let target = method_call.syntax().text_range(); |