From 2bfb65db93e48d8f9e8ecac0b2ea837c081a4db5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 9 Apr 2020 18:40:43 +0200 Subject: Be consistent about token accesors --- crates/ra_assists/src/handlers/inline_local_variable.rs | 2 +- crates/ra_assists/src/handlers/introduce_variable.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_assists/src') diff --git a/crates/ra_assists/src/handlers/inline_local_variable.rs b/crates/ra_assists/src/handlers/inline_local_variable.rs index 3bfcba8ff..b9eb09676 100644 --- a/crates/ra_assists/src/handlers/inline_local_variable.rs +++ b/crates/ra_assists/src/handlers/inline_local_variable.rs @@ -29,7 +29,7 @@ pub(crate) fn inline_local_variable(ctx: AssistCtx) -> Option { ast::Pat::BindPat(pat) => pat, _ => return None, }; - if bind_pat.is_mutable() { + if bind_pat.mut_kw_token().is_some() { tested_by!(test_not_inline_mut_variable); return None; } diff --git a/crates/ra_assists/src/handlers/introduce_variable.rs b/crates/ra_assists/src/handlers/introduce_variable.rs index 8a02f1a32..ab6bdf6bb 100644 --- a/crates/ra_assists/src/handlers/introduce_variable.rs +++ b/crates/ra_assists/src/handlers/introduce_variable.rs @@ -61,7 +61,7 @@ pub(crate) fn introduce_variable(ctx: AssistCtx) -> Option { }; if is_full_stmt { tested_by!(test_introduce_var_expr_stmt); - if !full_stmt.unwrap().has_semi() { + if full_stmt.unwrap().semi_token().is_none() { buf.push_str(";"); } edit.replace(expr.syntax().text_range(), buf); -- cgit v1.2.3