mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
use uniform accessor
This commit is contained in:
parent
046a021013
commit
00ec0c1066
@ -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) => {
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user