Remove ref patterns from rustc_ast
Also use if let chains in one case.
This commit is contained in:
@@ -601,9 +601,10 @@ impl Token {
|
||||
|
||||
/// Returns `true` if the token is an interpolated path.
|
||||
fn is_path(&self) -> bool {
|
||||
if let Interpolated(ref nt) = self.kind && let NtPath(..) = **nt {
|
||||
if let Interpolated(nt) = &self.kind && let NtPath(..) = **nt {
|
||||
return true;
|
||||
}
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
@@ -611,7 +612,7 @@ impl Token {
|
||||
/// That is, is this a pre-parsed expression dropped into the token stream
|
||||
/// (which happens while parsing the result of macro expansion)?
|
||||
pub fn is_whole_expr(&self) -> bool {
|
||||
if let Interpolated(ref nt) = self.kind
|
||||
if let Interpolated(nt) = &self.kind
|
||||
&& let NtExpr(_) | NtLiteral(_) | NtPath(_) | NtBlock(_) = **nt
|
||||
{
|
||||
return true;
|
||||
@@ -622,9 +623,10 @@ impl Token {
|
||||
|
||||
// Is the token an interpolated block (`$b:block`)?
|
||||
pub fn is_whole_block(&self) -> bool {
|
||||
if let Interpolated(ref nt) = self.kind && let NtBlock(..) = **nt {
|
||||
if let Interpolated(nt) = &self.kind && let NtBlock(..) = **nt {
|
||||
return true;
|
||||
}
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user