more clippy::style fixes:
get_first single_char_add_str unnecessary_mut_passed manual_map manual_is_ascii_check
This commit is contained in:
parent
ed4c5fef72
commit
af2b370100
8 changed files with 12 additions and 20 deletions
|
@ -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),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue