Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
) ## Summary This PR removes the `Iterator::chain(...)` sequence in `RuleCodePrefix::iter()` with `Vec::expand` to avoid an overlong-recursive types. The existing `RuleCodePrefix::iter` method chains all rule group iterators together. This leads to very long recursive types `Chain<Map<Chain<Map<Chain<Map.....>>>>` (proportional to the number of rule groups). This PR rewrites the macro to use `Vec::extend` instead, which removes the long recursive type (at the cost of introducing a potential allocation). ## Alternatives An alternative would be to use a stack allocated array by unrolling the `Linter::iter` methods (generated by `EnumIter`). I don't think it's worth the extra complexity, considering that `RuleCodePrefix::iter` isn't a hot function. ## Test Plan `cargo test`
- Loading branch information