we can derive default
@@ -6,18 +6,11 @@ use std::collections::HashMap;
///
/// This is similar to the type provided by the `anymap` crate, but we can get away with simpler
/// types on the methods due to our more specialized use case.
+#[derive(Default)]
pub struct CtxMap {
map: HashMap<TypeId, RefCell<Box<dyn Any>>>,
}
-impl Default for CtxMap {
- fn default() -> Self {
- CtxMap {
- map: HashMap::default(),
- }
- }
-}
-
impl CtxMap {
pub fn clear(&mut self) {
self.map.clear();
