diff --git a/tasks/linter_codegen/src/main.rs b/tasks/linter_codegen/src/main.rs index 605d44e367fee..bcc0f4f27daf3 100644 --- a/tasks/linter_codegen/src/main.rs +++ b/tasks/linter_codegen/src/main.rs @@ -93,6 +93,7 @@ fn find_rule_source_file(root: &Path, rule: &RuleEntry) -> Option { /// The module name of the rule's plugin, like `eslint` in `eslint::no_debugger::NoDebugger`. plugin_module_name: &'e str, @@ -141,14 +142,7 @@ fn get_all_rules(contents: &str) -> io::Result>> { rule_entries.push(RuleEntry { plugin_module_name, rule_module_name }); } // Sort deterministically - rule_entries.sort_by(|a, b| { - let ord = a.plugin_module_name.cmp(b.plugin_module_name); - if ord == std::cmp::Ordering::Equal { - a.rule_module_name.cmp(b.rule_module_name) - } else { - ord - } - }); + rule_entries.sort_unstable(); Ok(rule_entries) }