Greatly simplify lifetime captures in edition 2024
This commit is contained in:
@@ -165,7 +165,7 @@ impl<K, V> SsoHashMap<K, V> {
|
||||
|
||||
/// Clears the map, returning all key-value pairs as an iterator. Keeps the
|
||||
/// allocated memory for reuse.
|
||||
pub fn drain(&mut self) -> impl Iterator<Item = (K, V)> + '_ {
|
||||
pub fn drain(&mut self) -> impl Iterator<Item = (K, V)> {
|
||||
match self {
|
||||
SsoHashMap::Array(array) => Either::Left(array.drain(..)),
|
||||
SsoHashMap::Map(map) => Either::Right(map.drain()),
|
||||
|
||||
@@ -80,7 +80,7 @@ impl<T> SsoHashSet<T> {
|
||||
|
||||
/// Clears the set, returning all elements in an iterator.
|
||||
#[inline]
|
||||
pub fn drain(&mut self) -> impl Iterator<Item = T> + '_ {
|
||||
pub fn drain(&mut self) -> impl Iterator<Item = T> {
|
||||
self.map.drain().map(entry_to_key)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user