simplify suggest_deref_ref_or_into
This commit is contained in:
parent
1599c5a821
commit
45b88aff10
3 changed files with 49 additions and 47 deletions
|
@ -1811,6 +1811,14 @@ impl Expr<'_> {
|
|||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn method_ident(&self) -> Option<Ident> {
|
||||
match self.kind {
|
||||
ExprKind::MethodCall(receiver_method, ..) => Some(receiver_method.ident),
|
||||
ExprKind::Unary(_, expr) | ExprKind::AddrOf(.., expr) => expr.method_ident(),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Checks if the specified expression is a built-in range literal.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue