//! This crate provides the `AnyMap` type, a safe and convenient store for one value of each type.
-#![feature(core, std_misc, convert)]
+#![cfg_attr(feature = "nightly", feature(core, std_misc))]
#![cfg_attr(test, feature(test))]
#![warn(missing_docs, unused_results)]
mod unchecked_any;
pub mod raw;
-#[cfg(feature = "clone")]
-mod with_clone;
/// A collection containing zero or one values for any given type and allowing convenient,
/// type-safe access to those values.
*v = new_v;
}
}
- assert_eq!(map.get().unwrap(), &B(200));
+ assert_eq!(map.get::<B>().unwrap(), &B(200));
assert_eq!(map.len(), 6);
assert_eq!(map2.get::<F>(), Some(&F(5)));
assert_eq!(map2.get::<J>(), Some(&J(6)));
}
+
+ #[cfg(feature = "concurrent")]
+ #[test]
+ fn test_concurrent() {
+ fn assert_concurrent<T: Send + Sync>() { }
+ assert_concurrent::<AnyMap>();
+ }
}