1 #![deny(unused_qualifications)] 2 3 #[macro_use] 4 extern crate num_derive; 5 use num::FromPrimitive; 6 use num::ToPrimitive; 7 8 #[derive(FromPrimitive, ToPrimitive)] 9 pub enum SomeEnum { 10 A = 1, 11 } 12 13 #[test] test_unused_qualifications()14fn test_unused_qualifications() { 15 assert!(SomeEnum::from_u64(1).is_some()); 16 assert!(SomeEnum::from_i64(-1).is_none()); 17 assert!(SomeEnum::A.to_i64().is_some()); 18 } 19