From a27ed338b86a61cdcc9cffe190398f42c20ba12d Mon Sep 17 00:00:00 2001 From: Andy Jewell Date: Thu, 24 Oct 2024 14:18:42 -0400 Subject: [PATCH] repair Ord for UseSegment --- src/imports.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/imports.rs b/src/imports.rs index b741dd9b5da..52b6e057a83 100644 --- a/src/imports.rs +++ b/src/imports.rs @@ -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) {