]> git.lizzy.rs Git - rust.git/commitdiff
use idiomatic formatting
authorTshepang Mbambo <tshepang@gmail.com>
Thu, 9 Feb 2023 08:57:52 +0000 (10:57 +0200)
committerTshepang Mbambo <tshepang@gmail.com>
Thu, 9 Feb 2023 08:57:52 +0000 (10:57 +0200)
Also, remove needless else

compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs

index db1acb599271696008ec0143c1f68a587ddf173f..b220a87bc658abe171e2f7cce84d9b1813710186 100644 (file)
@@ -802,18 +802,19 @@ pub fn find_param_in_ty(
         let mut walk = ty.walk();
         while let Some(arg) = walk.next() {
             if arg == param_to_point_at {
-            return true;
-        } else if let ty::GenericArgKind::Type(ty) = arg.unpack()
-            && let ty::Alias(ty::Projection, ..) = ty.kind()
-        {
-            // This logic may seem a bit strange, but typically when
-            // we have a projection type in a function signature, the
-            // argument that's being passed into that signature is
-            // not actually constraining that projection's substs in
-            // a meaningful way. So we skip it, and see improvements
-            // in some UI tests.
-            walk.skip_current_subtree();
-        }
+                return true;
+            }
+            if let ty::GenericArgKind::Type(ty) = arg.unpack()
+                && let ty::Alias(ty::Projection, ..) = ty.kind()
+            {
+                // This logic may seem a bit strange, but typically when
+                // we have a projection type in a function signature, the
+                // argument that's being passed into that signature is
+                // not actually constraining that projection's substs in
+                // a meaningful way. So we skip it, and see improvements
+                // in some UI tests.
+                walk.skip_current_subtree();
+            }
         }
         false
     }