From 00ec0c10669307bc752812f535f96e121338d688 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 9 Apr 2020 23:19:51 +0200 Subject: [PATCH] use uniform accessor --- crates/ra_hir_def/src/body/lower.rs | 2 +- crates/ra_syntax/src/ast/expr_extensions.rs | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index df560155c6c..4f23cb5c854 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs @@ -372,7 +372,7 @@ fn collect_expr(&mut self, expr: ast::Expr) -> ExprId { } ast::Expr::RefExpr(e) => { let expr = self.collect_expr_opt(e.expr()); - let mutability = Mutability::from_mutable(e.is_mut()); + let mutability = Mutability::from_mutable(e.mut_kw_token().is_some()); self.alloc_expr(Expr::Ref { expr, mutability }, syntax_ptr) } ast::Expr::PrefixExpr(e) => { diff --git a/crates/ra_syntax/src/ast/expr_extensions.rs b/crates/ra_syntax/src/ast/expr_extensions.rs index 003ee00b3e5..5c5f196224b 100644 --- a/crates/ra_syntax/src/ast/expr_extensions.rs +++ b/crates/ra_syntax/src/ast/expr_extensions.rs @@ -49,10 +49,6 @@ fn blocks(&self) -> AstChildren { } impl ast::RefExpr { - pub fn is_mut(&self) -> bool { - self.syntax().children_with_tokens().any(|n| n.kind() == T![mut]) - } - pub fn raw_token(&self) -> Option { None // FIXME: implement &raw }