pub fn sort_rules_by_specificity(rules: &mut [Rule])
Sort rules so more specific patterns (more variables, longer patterns) match first