Skip to content

Commit 95eb1e2

Browse files
committed
Streamline description of versionsort (incorporate suggestion from Ralf)
1 parent 47bb076 commit 95eb1e2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/doc/style-guide/src/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,9 @@ For the purposes of the Rust style, to compare two strings for version-sorting:
112112
- Compare the strings by (Unicode) character as normal, finding the index of
113113
the first differing character. (If the two strings do not have the same
114114
length, this may be the end of the shorter string.)
115-
- For both strings, determine the longest sequence of ASCII digits containing
116-
either that character or the character before. (If either string doesn't have
117-
such a sequence of ASCII digits, fall back to comparing the strings as
118-
normal.)
115+
- For both strings, determine the longest sequence of ASCII digits that either
116+
contains or ends at that index. (If either string doesn't have such a
117+
sequence of ASCII digits, fall back to comparing the strings as normal.)
119118
- Compare the numeric values of the number specified by the sequence of digits.
120119
(Note that an implementation of this algorithm can easily check this without
121120
accumulating copies of the digits or converting to a number: after skipping

0 commit comments

Comments
 (0)