about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src/binary_search_util
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_data_structures/src/binary_search_util')
-rw-r--r--compiler/rustc_data_structures/src/binary_search_util/mod.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_data_structures/src/binary_search_util/mod.rs b/compiler/rustc_data_structures/src/binary_search_util/mod.rs
index bf09b2f8eef..d40172a2e2f 100644
--- a/compiler/rustc_data_structures/src/binary_search_util/mod.rs
+++ b/compiler/rustc_data_structures/src/binary_search_util/mod.rs
@@ -10,9 +10,8 @@ pub fn binary_search_slice<'d, E, K>(data: &'d [E], key_fn: impl Fn(&E) -> K, ke
 where
     K: Ord,
 {
-    let mid = match data.binary_search_by_key(key, &key_fn) {
-        Ok(mid) => mid,
-        Err(_) => return &[],
+    let Ok(mid) = data.binary_search_by_key(key, &key_fn) else {
+        return &[];
     };
     let size = data.len();