use alloc::vec::Vec;
pub trait Reclaimable {
fn reclaim(self) -> Self;
}
impl<T> Reclaimable for Vec<T> {
fn reclaim(mut self) -> Self {
self.clear();
self
}
}
impl<K, V, S: Clone> Reclaimable for hashbrown::HashMap<K, V, S> {
fn reclaim(mut self) -> Self {
self.clear();
self
}
}
impl<K, S: Clone> Reclaimable for hashbrown::HashSet<K, S> {
fn reclaim(mut self) -> Self {
self.clear();
self
}
}
impl<K, S: Clone> Reclaimable for indexmap::IndexSet<K, S> {
fn reclaim(mut self) -> Self {
self.clear();
self
}
}
impl<K: Ord, V> Reclaimable for alloc::collections::BTreeMap<K, V> {
fn reclaim(mut self) -> Self {
self.clear();
self
}
}
impl<K, V> Reclaimable for crate::arena::HandleVec<K, V> {
fn reclaim(mut self) -> Self {
self.clear();
self
}
}