Open 1uf3 opened 1 year ago
I would like a macro that does not put only certain elements in the EnumIter that creates an iterator for all Enum elements.
Example.
use strum::IntoEnumIterator; use strum_macros::EnumIter; #[derive(EnumIter, Debug, PartialEq)] enum Color { Red, Green { range: usize }, Blue(usize), #[exclude] Yellow, } let mut ci = Color::iter(); assert_eq!(Some(Color::Red), ci.next()); assert_eq!(Some(Color::Green {range: 0}), ci.next()); assert_eq!(Some(Color::Blue(0)), ci.next()); assert_eq!(None, ci.next());
I would like a macro that does not put only certain elements in the EnumIter that creates an iterator for all Enum elements.
Example.