Remove useless borrows and derefs
This commit is contained in:
parent
9c0bc3028a
commit
f2b97a8bfe
41 changed files with 145 additions and 146 deletions
|
@ -1179,7 +1179,7 @@ impl Expr {
|
|||
pub fn peel_parens(&self) -> &Expr {
|
||||
let mut expr = self;
|
||||
while let ExprKind::Paren(inner) = &expr.kind {
|
||||
expr = &inner;
|
||||
expr = inner;
|
||||
}
|
||||
expr
|
||||
}
|
||||
|
@ -2027,7 +2027,7 @@ impl Ty {
|
|||
pub fn peel_refs(&self) -> &Self {
|
||||
let mut final_ty = self;
|
||||
while let TyKind::Rptr(_, MutTy { ty, .. }) = &final_ty.kind {
|
||||
final_ty = &ty;
|
||||
final_ty = ty;
|
||||
}
|
||||
final_ty
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue