Closed
Description
Can we move HashMap
to alloc::collections
?
std
could use a type alias to assume the default, and use a trait to add the new
and with_capacity
methods back.
pub type HashMap<K, V, S = RandomState> = alloc::collections::hash_map::HashMap<K, V, S>;
pub trait HashMapExt {
fn new() -> Self;
fn with_capacity(n: usize) -> Self;
}
impl<K: Eq + Hash, V> HashMapExt for HashMap<K, V> {
fn new() -> Self { .. }
fn with_capacity(n: usize) -> Self { .. }
}