1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#![allow(unused)] use enum_info::enum_info; #[test] fn test_option() { // Should have 2 variants: Some(T), None #[enum_info] enum Optional<T> { Some(T), None } assert_eq!(Optional::<()>::variant_count(), 2); }