]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir_typeck/src/method/probe.rs
small method code cleanup
[rust.git] / compiler / rustc_hir_typeck / src / method / probe.rs
index 44c3edf06a8837a492959696d9beb06aebd15dbe..37f9cdfeebc60096312decbfd01864c7f3954edf 100644 (file)
@@ -342,10 +342,9 @@ fn probe_op<OP, R>(
             &mut orig_values,
         );
 
-        let steps = if mode == Mode::MethodCall {
-            self.tcx.method_autoderef_steps(param_env_and_self_ty)
-        } else {
-            self.probe(|_| {
+        let steps = match mode {
+            Mode::MethodCall => self.tcx.method_autoderef_steps(param_env_and_self_ty),
+            Mode::Path => self.probe(|_| {
                 // Mode::Path - the deref steps is "trivial". This turns
                 // our CanonicalQuery into a "trivial" QueryResponse. This
                 // is a bit inefficient, but I don't think that writing
@@ -374,7 +373,7 @@ fn probe_op<OP, R>(
                     opt_bad_ty: None,
                     reached_recursion_limit: false,
                 }
-            })
+            }),
         };
 
         // If our autoderef loop had reached the recursion limit,