about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src/sso/map.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-07-23 13:11:20 +0200
committerMatthias Krüger <matthias.krueger@famsik.de>2023-07-23 23:39:04 +0200
commitaf2b370100cdc1767772af738a3259875bba38f3 (patch)
treef23ae1202075676a30b7d148e46caf4f86ba1327 /compiler/rustc_data_structures/src/sso/map.rs
parented4c5fef728e2d1288134ff0938182ec52cff621 (diff)
downloadrust-af2b370100cdc1767772af738a3259875bba38f3.tar.gz
rust-af2b370100cdc1767772af738a3259875bba38f3.zip
more clippy::style fixes:
get_first
single_char_add_str
unnecessary_mut_passed
manual_map
manual_is_ascii_check
Diffstat (limited to 'compiler/rustc_data_structures/src/sso/map.rs')
-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),
         }