about summary refs log tree commit diff
path: root/compiler/rustc_ast/src/ast.rs
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2022-11-29 11:01:17 +0000
committerMaybe Waffle <waffle.lapkin@gmail.com>2022-12-01 17:34:43 +0000
commitf2b97a8bfe23cdda293908e3c3e01f2613787168 (patch)
treea7fe31c1e002272731591d9f0e2337f19de420d3 /compiler/rustc_ast/src/ast.rs
parent9c0bc3028a575eece6d4e8fbc6624cb95b9c9893 (diff)
downloadrust-f2b97a8bfe23cdda293908e3c3e01f2613787168.tar.gz
rust-f2b97a8bfe23cdda293908e3c3e01f2613787168.zip
Remove useless borrows and derefs
Diffstat (limited to 'compiler/rustc_ast/src/ast.rs')
-rw-r--r--compiler/rustc_ast/src/ast.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs
index 6a2f1f0c574..6df00411ab3 100644
--- a/compiler/rustc_ast/src/ast.rs
+++ b/compiler/rustc_ast/src/ast.rs
@@ -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
     }