about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDániel Buga <bugadani@gmail.com>2021-02-07 23:05:15 +0100
committerDániel Buga <bugadani@gmail.com>2021-02-08 00:24:36 +0100
commit37cbc08a927a85d4da5e04fdf6de3452fc109c58 (patch)
tree61c7ee981fae037b0f5dc027481b2f2e71a23bd4
parent3182375e064b8fa90437aee1465bccafd8187d89 (diff)
downloadrust-37cbc08a927a85d4da5e04fdf6de3452fc109c58.tar.gz
rust-37cbc08a927a85d4da5e04fdf6de3452fc109c58.zip
Clean up weird option mapping
-rw-r--r--compiler/rustc_typeck/src/check/expr.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/compiler/rustc_typeck/src/check/expr.rs b/compiler/rustc_typeck/src/check/expr.rs
index 04c83a7665c..5f5d552ccc8 100644
--- a/compiler/rustc_typeck/src/check/expr.rs
+++ b/compiler/rustc_typeck/src/check/expr.rs
@@ -285,13 +285,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 self.check_expr_eq_type(&e, ty);
                 ty
             }
-            ExprKind::If(ref cond, ref then_expr, ref opt_else_expr) => self.check_then_else(
-                &cond,
-                then_expr,
-                opt_else_expr.as_ref().map(|e| &**e),
-                expr.span,
-                expected,
-            ),
+            ExprKind::If(cond, then_expr, opt_else_expr) => {
+                self.check_then_else(cond, then_expr, opt_else_expr, expr.span, expected)
+            }
             ExprKind::DropTemps(ref e) => self.check_expr_with_expectation(e, expected),
             ExprKind::Array(ref args) => self.check_expr_array(args, expected, expr),
             ExprKind::ConstBlock(ref anon_const) => self.to_const(anon_const).ty,