about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2024-08-07 12:41:49 +0200
committerLeón Orell Valerian Liehr <me@fmease.dev>2024-08-07 13:37:52 +0200
commitc4c518d2d496774ecc7a368e826480d1928ed1ab (patch)
tree71e199c5e79d70938c20c1f8fa3b3a892cc99245 /compiler/rustc_data_structures/src
parent60d146580c10036ce89e019422c6bc2fd9729b65 (diff)
downloadrust-c4c518d2d496774ecc7a368e826480d1928ed1ab.tar.gz
rust-c4c518d2d496774ecc7a368e826480d1928ed1ab.zip
Use more slice patterns inside the compiler
Diffstat (limited to 'compiler/rustc_data_structures/src')
-rw-r--r--compiler/rustc_data_structures/src/transitive_relation.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_data_structures/src/transitive_relation.rs b/compiler/rustc_data_structures/src/transitive_relation.rs
index 26b00e0af3a..e81ebb9a4be 100644
--- a/compiler/rustc_data_structures/src/transitive_relation.rs
+++ b/compiler/rustc_data_structures/src/transitive_relation.rs
@@ -203,9 +203,9 @@ impl<T: Eq + Hash + Copy> TransitiveRelation<T> {
     /// exists). See `postdom_upper_bound` for details.
     pub fn mutual_immediate_postdominator(&self, mut mubs: Vec<T>) -> Option<T> {
         loop {
-            match mubs.len() {
-                0 => return None,
-                1 => return Some(mubs[0]),
+            match mubs[..] {
+                [] => return None,
+                [mub] => return Some(mub),
                 _ => {
                     let m = mubs.pop().unwrap();
                     let n = mubs.pop().unwrap();