-
Notifications
You must be signed in to change notification settings - Fork 898
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix versionsort chunk split on non-ASCII numerics (#6407)
Replaces `char::is_numeric()` with `char::is_ascii_digit()` in `VersionChunkIter::parse_str_chunk()`. The text in the Style Guide explicitly mentions that a numeric chunk is a sequence of ASCII digits.
- Loading branch information
1 parent
0a32a02
commit 78aa72f
Showing
5 changed files
with
90 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// rustfmt-style_edition: 2015 | ||
|
||
// ascii-betically sorted | ||
pub use print๙msg; | ||
pub use print0msg; | ||
pub use printémsg; | ||
|
||
fn main() {} | ||
|
||
/// '๙' = 0E59;THAI DIGIT NINE;Nd; (Non-ASCII Decimal_Number, sorts third) | ||
mod print๙msg {} | ||
|
||
/// '0' = 0030;DIGIT ZERO;Nd; (ASCII Decimal_Number, sorts first) | ||
mod print0msg {} | ||
|
||
/// 'é' = 00E9;LATIN SMALL LETTER E WITH ACUTE;Ll; (Lowercase_Letter, sorts second) | ||
mod printémsg {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// rustfmt-style_edition: 2024 | ||
|
||
// versionsorted | ||
pub use print๙msg; | ||
pub use print0msg; | ||
pub use printémsg; | ||
|
||
fn main() {} | ||
|
||
/// '๙' = 0E59;THAI DIGIT NINE;Nd; (Non-ASCII Decimal_Number, one string chunk) | ||
/// | ||
/// U+0E59 > U+00E9, sorts third | ||
mod print๙msg {} | ||
|
||
/// '0' = 0030;DIGIT ZERO;Nd; (ASCII Decimal_Number, splits into 3 chunks ("print",0,"msg")) | ||
/// | ||
/// shortest chunk "print", sorts first | ||
mod print0msg {} | ||
|
||
/// 'é' = 00E9;LATIN SMALL LETTER E WITH ACUTE;Ll; (Lowercase_Letter, one string chunk) | ||
/// | ||
/// U+00E9 < U+0E59, sorts second | ||
mod printémsg {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// rustfmt-style_edition: 2015 | ||
|
||
// ascii-betically sorted | ||
pub use print0msg; | ||
pub use printémsg; | ||
pub use print๙msg; | ||
|
||
fn main() {} | ||
|
||
/// '๙' = 0E59;THAI DIGIT NINE;Nd; (Non-ASCII Decimal_Number, sorts third) | ||
mod print๙msg {} | ||
|
||
/// '0' = 0030;DIGIT ZERO;Nd; (ASCII Decimal_Number, sorts first) | ||
mod print0msg {} | ||
|
||
/// 'é' = 00E9;LATIN SMALL LETTER E WITH ACUTE;Ll; (Lowercase_Letter, sorts second) | ||
mod printémsg {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// rustfmt-style_edition: 2024 | ||
|
||
// versionsorted | ||
pub use print0msg; | ||
pub use printémsg; | ||
pub use print๙msg; | ||
|
||
fn main() {} | ||
|
||
/// '๙' = 0E59;THAI DIGIT NINE;Nd; (Non-ASCII Decimal_Number, one string chunk) | ||
/// | ||
/// U+0E59 > U+00E9, sorts third | ||
mod print๙msg {} | ||
|
||
/// '0' = 0030;DIGIT ZERO;Nd; (ASCII Decimal_Number, splits into 3 chunks ("print",0,"msg")) | ||
/// | ||
/// shortest chunk "print", sorts first | ||
mod print0msg {} | ||
|
||
/// 'é' = 00E9;LATIN SMALL LETTER E WITH ACUTE;Ll; (Lowercase_Letter, one string chunk) | ||
/// | ||
/// U+00E9 < U+0E59, sorts second | ||
mod printémsg {} |