]> git.lizzy.rs Git - rust.git/commitdiff
Remove Option only used as its Some variant
authorOli Scherer <github35764891676564198441@oli-obk.de>
Wed, 28 Jul 2021 16:36:06 +0000 (16:36 +0000)
committerOli Scherer <github35764891676564198441@oli-obk.de>
Fri, 6 Aug 2021 10:27:37 +0000 (10:27 +0000)
compiler/rustc_mir/src/borrow_check/type_check/mod.rs

index 3fb06cd2f5f441e1e93234fb9302d4c49d48fb63..44e38a018a6e91bc73afc745f96fe5452bb2017d 100644 (file)
@@ -1344,10 +1344,7 @@ fn eq_opaque_type_and_type(
 
                     debug!("eq_opaque_type_and_type: equated");
 
-                    Ok(InferOk {
-                        value: Some(opaque_type_map),
-                        obligations: obligations.into_vec(),
-                    })
+                    Ok(InferOk { value: opaque_type_map, obligations: obligations.into_vec() })
                 },
                 || "input_output".to_string(),
             ),
@@ -1361,25 +1358,23 @@ fn eq_opaque_type_and_type(
         // have to solve any bounds (e.g., `-> impl Iterator` needs to
         // prove that `T: Iterator` where `T` is the type we
         // instantiated it with).
-        if let Some(opaque_type_map) = opaque_type_map {
-            for (opaque_type_key, opaque_decl) in opaque_type_map {
-                self.fully_perform_op(
-                    locations,
-                    ConstraintCategory::OpaqueType,
-                    CustomTypeOp::new(
-                        |infcx| {
-                            infcx.constrain_opaque_type(
-                                opaque_type_key,
-                                &opaque_decl,
-                                GenerateMemberConstraints::IfNoStaticBound,
-                                universal_region_relations,
-                            );
-                            Ok(InferOk { value: (), obligations: vec![] })
-                        },
-                        || "opaque_type_map".to_string(),
-                    ),
-                )?;
-            }
+        for (opaque_type_key, opaque_decl) in opaque_type_map {
+            self.fully_perform_op(
+                locations,
+                ConstraintCategory::OpaqueType,
+                CustomTypeOp::new(
+                    |infcx| {
+                        infcx.constrain_opaque_type(
+                            opaque_type_key,
+                            &opaque_decl,
+                            GenerateMemberConstraints::IfNoStaticBound,
+                            universal_region_relations,
+                        );
+                        Ok(InferOk { value: (), obligations: vec![] })
+                    },
+                    || "opaque_type_map".to_string(),
+                ),
+            )?;
         }
         Ok(())
     }