mirror of
https://github.com/astral-sh/ruff
synced 2026-01-21 13:30:49 -05:00
RuleSelector implemented PartialOrd & Ord because ruff::flake8_to_ruff was using RuleSelector within a BTreeSet (which requires contained elements to implement Ord). There however is no inherent order to rule selectors, so PartialOrd & Ord should not be implemented. This commit changes BTreeSet<RuleSelector> to HashSet<RuleSelector> and adds an explicit sort calls based on the serialized strings, letting us drop the PartialOrd & Ord impls in favor of a Hash impl.