Greatly simplify lifetime captures in edition 2024

This commit is contained in:
Michael Goulet
2025-02-20 18:58:46 +00:00
parent 46420c9607
commit 12e3911d81
84 changed files with 223 additions and 294 deletions

View File

@@ -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()),

View File

@@ -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)
}
}