about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-07-26 09:09:06 +0000
committerbors <bors@rust-lang.org>2023-07-26 09:09:06 +0000
commit6ac86bb19f9102a1f887afde3395d066db62d743 (patch)
treefabbf8fc4dabec565022821957385793eb17bd94 /compiler/rustc_data_structures/src
parentcba1df1b666ba3ec0a02188d4fa3332aaab31296 (diff)
parent38665a12be721cb19a745bdbde6afd5c058d2b20 (diff)
downloadrust-6ac86bb19f9102a1f887afde3395d066db62d743.tar.gz
rust-6ac86bb19f9102a1f887afde3395d066db62d743.zip
Auto merge of #2991 - rust-lang:rustup-2023-07-26, r=RalfJung
Automatic sync from rustc
Diffstat (limited to 'compiler/rustc_data_structures/src')
-rw-r--r--compiler/rustc_data_structures/src/sso/map.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/compiler/rustc_data_structures/src/sso/map.rs b/compiler/rustc_data_structures/src/sso/map.rs
index 99581ed2375..04e359a5470 100644
--- a/compiler/rustc_data_structures/src/sso/map.rs
+++ b/compiler/rustc_data_structures/src/sso/map.rs
@@ -268,11 +268,7 @@ impl<K: Eq + Hash, V> SsoHashMap<K, V> {
     pub fn remove_entry(&mut self, key: &K) -> Option<(K, V)> {
         match self {
             SsoHashMap::Array(array) => {
-                if let Some(index) = array.iter().position(|(k, _v)| k == key) {
-                    Some(array.swap_remove(index))
-                } else {
-                    None
-                }
+                array.iter().position(|(k, _v)| k == key).map(|index| array.swap_remove(index))
             }
             SsoHashMap::Map(map) => map.remove_entry(key),
         }