use uniform accessor

This commit is contained in:
Aleksey Kladov 2020-04-09 23:19:51 +02:00
parent 046a021013
commit 00ec0c1066
2 changed files with 1 additions and 5 deletions

View File

@ -372,7 +372,7 @@ impl ExprCollector<'_> {
} }
ast::Expr::RefExpr(e) => { ast::Expr::RefExpr(e) => {
let expr = self.collect_expr_opt(e.expr()); 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) self.alloc_expr(Expr::Ref { expr, mutability }, syntax_ptr)
} }
ast::Expr::PrefixExpr(e) => { ast::Expr::PrefixExpr(e) => {

View File

@ -49,10 +49,6 @@ impl ast::IfExpr {
} }
impl ast::RefExpr { 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<SyntaxToken> { pub fn raw_token(&self) -> Option<SyntaxToken> {
None // FIXME: implement &raw None // FIXME: implement &raw
} }