use enum_helpers::EnumIs; #[derive(EnumIs)] pub enum GenericIs { A, B(T), } #[test] fn test_generic_is() { let a = GenericIs::::A; assert!(a.is_a()); assert!(!a.is_b()); let b = GenericIs::::B(1); assert!(!b.is_a()); assert!(b.is_b()); }