From 863b1fb731e797f02daeac87a94d40a34222a062 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 21 Aug 2020 19:12:38 +0200 Subject: :arrow_up: ungrammar --- crates/assists/src/handlers/auto_import.rs | 2 +- crates/assists/src/handlers/replace_unwrap_with_match.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/assists') 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 { return None; } Some(Self::TraitMethod( - sema.type_of_expr(&method_call.expr()?)?, + sema.type_of_expr(&method_call.receiver()?)?, method_call.name_ref()?.syntax().to_string(), )) } 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) if name.text() != "unwrap" { return None; } - let caller = method_call.expr()?; + let caller = method_call.receiver()?; let ty = ctx.sema.type_of_expr(&caller)?; let happy_variant = TryEnum::from_ty(&ctx.sema, &ty)?.happy_case(); let target = method_call.syntax().text_range(); -- cgit v1.2.3