about summary refs log tree commit diff
path: root/src/librustdoc/html/render/tests.rs
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2024-07-24 10:08:28 -0700
committerMichael Howell <michael@notriddle.com>2024-07-24 11:08:44 -0700
commit53846925cabfd730489e3902a2840826325a9a60 (patch)
tree61ce279861ee12fd82627f3d8c2559552704181c /src/librustdoc/html/render/tests.rs
parent2ccafed862f6906707a390caf180449dd64cad2e (diff)
downloadrust-53846925cabfd730489e3902a2840826325a9a60.tar.gz
rust-53846925cabfd730489e3902a2840826325a9a60.zip
rustdoc: clean up and fix ord violations in item sorting
Based on e3fdafc263a4a705a3bec1a6865a4d011b2ec7c5 with a few
minor changes:

- The name sorting function is changed to follow the [version sort]
  from the style guide
- the `cmp` function is redesigned to more obviously make a
  partial order, by always return `cmp()` of the same variable as
  the `!=` above

[version sort]: https://doc.rust-lang.org/nightly/style-guide/index.html#sorting

Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
Diffstat (limited to 'src/librustdoc/html/render/tests.rs')
-rw-r--r--src/librustdoc/html/render/tests.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustdoc/html/render/tests.rs b/src/librustdoc/html/render/tests.rs
index 3175fbe5666..4a9724a6f84 100644
--- a/src/librustdoc/html/render/tests.rs
+++ b/src/librustdoc/html/render/tests.rs
@@ -34,7 +34,7 @@ fn test_compare_names() {
 #[test]
 fn test_name_sorting() {
     let names = [
-        "Apple", "Banana", "Fruit", "Fruit0", "Fruit00", "Fruit01", "Fruit1", "Fruit02", "Fruit2",
+        "Apple", "Banana", "Fruit", "Fruit0", "Fruit00", "Fruit01", "Fruit02", "Fruit1", "Fruit2",
         "Fruit20", "Fruit30x", "Fruit100", "Pear",
     ];
     let mut sorted = names.to_owned();