about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJarredAllen <jarredallen73@gmail.com>2020-05-31 12:06:32 -0700
committerJarredAllen <jarredallen73@gmail.com>2020-05-31 12:06:32 -0700
commit20cb512e81ad03a014b40c377a01fdebaea66963 (patch)
tree9c1aefc010fe41531f206dd9705933fd2d9761e8
parent015ab9f9259d58a48c171276f6e7190528f1a9ad (diff)
downloadrust-20cb512e81ad03a014b40c377a01fdebaea66963.tar.gz
rust-20cb512e81ad03a014b40c377a01fdebaea66963.zip
Updated test cases and formatted
-rw-r--r--clippy_lints/src/lib.rs2
-rw-r--r--tests/ui/unnecessary_sort_by.fixed1
-rw-r--r--tests/ui/unnecessary_sort_by.rs1
-rw-r--r--tests/ui/unnecessary_sort_by.stderr24
4 files changed, 9 insertions, 19 deletions
diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs
index 46df743b5bf..fd832d11577 100644
--- a/clippy_lints/src/lib.rs
+++ b/clippy_lints/src/lib.rs
@@ -304,7 +304,6 @@ mod serde_api;
 mod shadow;
 mod single_component_path_imports;
 mod slow_vector_initialization;
-mod unnecessary_sort_by;
 mod strings;
 mod suspicious_trait_impl;
 mod swap;
@@ -319,6 +318,7 @@ mod try_err;
 mod types;
 mod unicode;
 mod unnamed_address;
+mod unnecessary_sort_by;
 mod unsafe_removed_from_name;
 mod unused_io_amount;
 mod unused_self;
diff --git a/tests/ui/unnecessary_sort_by.fixed b/tests/ui/unnecessary_sort_by.fixed
index bb88df1a56c..4521ae38d49 100644
--- a/tests/ui/unnecessary_sort_by.fixed
+++ b/tests/ui/unnecessary_sort_by.fixed
@@ -1,5 +1,4 @@
 // run-rustfix
-#![warn(clippy::sort_by_key)]
 
 use std::cmp::Reverse;
 
diff --git a/tests/ui/unnecessary_sort_by.rs b/tests/ui/unnecessary_sort_by.rs
index 953c573d406..fdb5a823369 100644
--- a/tests/ui/unnecessary_sort_by.rs
+++ b/tests/ui/unnecessary_sort_by.rs
@@ -1,5 +1,4 @@
 // run-rustfix
-#![warn(clippy::sort_by_key_reverse)]
 
 use std::cmp::Reverse;
 
diff --git a/tests/ui/unnecessary_sort_by.stderr b/tests/ui/unnecessary_sort_by.stderr
index 291fd5500f7..b6365c1709d 100644
--- a/tests/ui/unnecessary_sort_by.stderr
+++ b/tests/ui/unnecessary_sort_by.stderr
@@ -1,48 +1,40 @@
 error: use Vec::sort here instead
-  --> $DIR/sort_by_key.rs:13:5
+  --> $DIR/unnecessary_sort_by.rs:12:5
    |
 LL |     vec.sort_by(|a, b| a.cmp(b));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec.sort()`
    |
-   = note: `-D clippy::sort-by-key` implied by `-D warnings`
+   = note: `-D clippy::unnecessary-sort-by` implied by `-D warnings`
 
 error: use Vec::sort_by_key here instead
-  --> $DIR/sort_by_key.rs:14:5
+  --> $DIR/unnecessary_sort_by.rs:13:5
    |
 LL |     vec.sort_by(|a, b| (a + 5).abs().cmp(&(b + 5).abs()));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec.sort_by_key(|&a| (a + 5).abs())`
 
 error: use Vec::sort_by_key here instead
-  --> $DIR/sort_by_key.rs:15:5
+  --> $DIR/unnecessary_sort_by.rs:14:5
    |
 LL |     vec.sort_by(|a, b| id(-a).cmp(&id(-b)));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec.sort_by_key(|&a| id(-a))`
 
 error: use Vec::sort_by_key here instead
-  --> $DIR/sort_by_key.rs:17:5
+  --> $DIR/unnecessary_sort_by.rs:16:5
    |
 LL |     vec.sort_by(|a, b| b.cmp(a));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec.sort_by_key(|&b| Reverse(b))`
 
 error: use Vec::sort_by_key here instead
-  --> $DIR/sort_by_key.rs:18:5
+  --> $DIR/unnecessary_sort_by.rs:17:5
    |
 LL |     vec.sort_by(|a, b| (b + 5).abs().cmp(&(a + 5).abs()));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec.sort_by_key(|&b| Reverse((b + 5).abs()))`
 
 error: use Vec::sort_by_key here instead
-  --> $DIR/sort_by_key.rs:19:5
+  --> $DIR/unnecessary_sort_by.rs:18:5
    |
 LL |     vec.sort_by(|a, b| id(-b).cmp(&id(-a)));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec.sort_by_key(|&b| Reverse(id(-b)))`
 
-error: unknown clippy lint: clippy::sort_by_key_reverse
-  --> $DIR/sort_by_key.rs:2:9
-   |
-LL | #![warn(clippy::sort_by_key_reverse)]
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `clippy::sort_by_key`
-   |
-   = note: `-D clippy::unknown-clippy-lints` implied by `-D warnings`
-
-error: aborting due to 7 previous errors
+error: aborting due to 6 previous errors