Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/stdx/src/anymap.rs')
| -rw-r--r-- | crates/stdx/src/anymap.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/crates/stdx/src/anymap.rs b/crates/stdx/src/anymap.rs index faf2e6c717..0c39419133 100644 --- a/crates/stdx/src/anymap.rs +++ b/crates/stdx/src/anymap.rs @@ -101,20 +101,15 @@ pub struct Map<A: ?Sized + Downcast = dyn Any> { /// `Map::new()` doesn’t seem to be happy to infer that it should go with the default /// value. It’s a bit sad, really. Ah well, I guess this approach will do. pub type AnyMap = Map<dyn Any>; + impl<A: ?Sized + Downcast> Default for Map<A> { #[inline] fn default() -> Map<A> { - Map::new() + Map { raw: RawMap::with_hasher(Default::default()) } } } impl<A: ?Sized + Downcast> Map<A> { - /// Create an empty collection. - #[inline] - pub fn new() -> Map<A> { - Map { raw: RawMap::with_hasher(Default::default()) } - } - /// Returns a reference to the value stored in the collection for the type `T`, /// if it exists. #[inline] |