use std::cmp;
-#[deriving(Show)]
+#[derive(Copy, Show)]
enum cat_type { tuxedo, tabby, tortoiseshell }
impl cmp::PartialEq for cat_type {
for _ in range(1u, 5) { nyan.speak(); }
assert!(*nyan.find(&1).unwrap() == "nyan".to_string());
assert_eq!(nyan.find(&10), None);
- let mut spotty: cat<cat_type> = cat::new(2, 57, tuxedo);
+ let mut spotty: cat<cat_type> = cat::new(2, 57, cat_type::tuxedo);
for _ in range(0u, 6) { spotty.speak(); }
assert_eq!(spotty.len(), 8);
assert!((spotty.contains_key(&2)));
- assert_eq!(spotty.get(&3), &tuxedo);
+ assert_eq!(spotty.get(&3), &cat_type::tuxedo);
}