Skip to content

Commit

Permalink
repair Ord for UseSegment
Browse files Browse the repository at this point in the history
  • Loading branch information
ajewellamz committed Oct 24, 2024
1 parent 96cc01b commit a27ed33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -943,10 +943,10 @@ impl Ord for UseSegment {
version_sort(ia, ib)
} else {
// snake_case < CamelCase < UPPER_SNAKE_CASE
if ia.starts_with(char::is_uppercase) && ib.starts_with(char::is_lowercase) {
if ia.starts_with(char::is_uppercase) && !ib.starts_with(char::is_uppercase) {
return Ordering::Greater;
}
if ia.starts_with(char::is_lowercase) && ib.starts_with(char::is_uppercase) {
if !ia.starts_with(char::is_uppercase) && ib.starts_with(char::is_uppercase) {
return Ordering::Less;
}
if is_upper_snake_case(ia) && !is_upper_snake_case(ib) {
Expand Down

0 comments on commit a27ed33

Please sign in to comment.