about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLingMan <LingMan@users.noreply.github.com>2021-01-15 21:29:28 +0100
committerLingMan <LingMan@users.noreply.github.com>2021-01-15 21:29:28 +0100
commitba1f036c7a3541729f43ca5a4127adddb4fc2e13 (patch)
tree5db696a46a2e505d96e803bd301c0fa99327660f
parente48eb37b9470a26748c916f7153569906f3c67bf (diff)
downloadrust-ba1f036c7a3541729f43ca5a4127adddb4fc2e13.tar.gz
rust-ba1f036c7a3541729f43ca5a4127adddb4fc2e13.zip
Drop a few unneeded borrows
-rw-r--r--compiler/rustc_typeck/src/check/fn_ctxt/checks.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs b/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs
index 4afa6689b92..6177e39ba9e 100644
--- a/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs
+++ b/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs
@@ -813,10 +813,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     if ty.is_never() {
                         None
                     } else {
-                        Some(match &elem.kind {
+                        Some(match elem.kind {
                             // Point at the tail expression when possible.
                             hir::ExprKind::Block(block, _) => {
-                                block.expr.as_ref().map_or(block.span, |e| e.span)
+                                block.expr.map_or(block.span, |e| e.span)
                             }
                             _ => elem.span,
                         })
@@ -824,14 +824,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 })
         };
 
-        if let hir::ExprKind::If(_, _, Some(el)) = &expr.kind {
+        if let hir::ExprKind::If(_, _, Some(el)) = expr.kind {
             if let Some(rslt) = check_in_progress(el) {
                 return rslt;
             }
         }
 
-        if let hir::ExprKind::Match(_, arms, _) = &expr.kind {
-            let mut iter = arms.iter().filter_map(|arm| check_in_progress(&arm.body));
+        if let hir::ExprKind::Match(_, arms, _) = expr.kind {
+            let mut iter = arms.iter().filter_map(|arm| check_in_progress(arm.body));
             if let Some(span) = iter.next() {
                 if iter.next().is_none() {
                     return span;