]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_data_structures/src/transitive_relation.rs
Rollup merge of #93385 - CraftSpider:rustdoc-ty-fixes, r=camelid
[rust.git] / compiler / rustc_data_structures / src / transitive_relation.rs
index ccf8bd69ebd0664af6787c93dc2dc91af1df3ca7..0af571610fe9510c553551e3f599caf4affaf85e 100644 (file)
@@ -190,11 +190,8 @@ pub fn mutual_immediate_postdominator<'a>(&'a self, mut mubs: Vec<&'a T>) -> Opt
     ///
     /// Note that this set can, in principle, have any size.
     pub fn minimal_upper_bounds(&self, a: &T, b: &T) -> Vec<&T> {
-        let (mut a, mut b) = match (self.index(a), self.index(b)) {
-            (Some(a), Some(b)) => (a, b),
-            (None, _) | (_, None) => {
-                return vec![];
-            }
+        let (Some(mut a), Some(mut b)) = (self.index(a), self.index(b)) else {
+            return vec![];
         };
 
         // in some cases, there are some arbitrary choices to be made;
@@ -294,9 +291,8 @@ pub fn minimal_upper_bounds(&self, a: &T, b: &T) -> Vec<&T> {
     /// then `parents(a)` returns `[b, c]`. The `postdom_parent` function
     /// would further reduce this to just `f`.
     pub fn parents(&self, a: &T) -> Vec<&T> {
-        let a = match self.index(a) {
-            Some(a) => a,
-            None => return vec![],
+        let Some(a) = self.index(a) else {
+            return vec![];
         };
 
         // Steal the algorithm for `minimal_upper_bounds` above, but