Fix ambiguity with CamelCase diagnostic messages

This commit is contained in:
Matthew Wilding 2024-09-29 16:35:37 +08:00
parent 546339a7be
commit 60219d0b11
No known key found for this signature in database
GPG key ID: D600998BF2EF83B9
4 changed files with 21 additions and 21 deletions

View file

@ -614,7 +614,7 @@ fn path_segment_cmp(a: &ast::PathSegment, b: &ast::PathSegment) -> Ordering {
(Some(_), None) => Ordering::Greater,
(None, Some(_)) => Ordering::Less,
(Some(a_name), Some(b_name)) => {
// snake_case < CamelCase < UPPER_SNAKE_CASE
// snake_case < UpperCamelCase < UPPER_SNAKE_CASE
let a_text = a_name.as_str().trim_start_matches("r#");
let b_text = b_name.as_str().trim_start_matches("r#");
if a_text.starts_with(char::is_lowercase)