]> git.lizzy.rs Git - rust.git/blob - tests/ui/unnecessary_sort_by.stderr
Auto merge of #5980 - matsujika:create-dir, r=flip1995
[rust.git] / tests / ui / unnecessary_sort_by.stderr
1 error: use Vec::sort here instead
2   --> $DIR/unnecessary_sort_by.rs:14:5
3    |
4 LL |     vec.sort_by(|a, b| a.cmp(b));
5    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec.sort()`
6    |
7    = note: `-D clippy::unnecessary-sort-by` implied by `-D warnings`
8
9 error: use Vec::sort here instead
10   --> $DIR/unnecessary_sort_by.rs:15:5
11    |
12 LL |     vec.sort_unstable_by(|a, b| a.cmp(b));
13    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec.sort_unstable()`
14
15 error: use Vec::sort_by_key here instead
16   --> $DIR/unnecessary_sort_by.rs:16:5
17    |
18 LL |     vec.sort_by(|a, b| (a + 5).abs().cmp(&(b + 5).abs()));
19    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec.sort_by_key(|&a| (a + 5).abs())`
20
21 error: use Vec::sort_by_key here instead
22   --> $DIR/unnecessary_sort_by.rs:17:5
23    |
24 LL |     vec.sort_unstable_by(|a, b| id(-a).cmp(&id(-b)));
25    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec.sort_unstable_by_key(|&a| id(-a))`
26
27 error: use Vec::sort_by_key here instead
28   --> $DIR/unnecessary_sort_by.rs:19:5
29    |
30 LL |     vec.sort_by(|a, b| b.cmp(a));
31    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec.sort_by_key(|&b| Reverse(b))`
32
33 error: use Vec::sort_by_key here instead
34   --> $DIR/unnecessary_sort_by.rs:20:5
35    |
36 LL |     vec.sort_by(|a, b| (b + 5).abs().cmp(&(a + 5).abs()));
37    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec.sort_by_key(|&b| Reverse((b + 5).abs()))`
38
39 error: use Vec::sort_by_key here instead
40   --> $DIR/unnecessary_sort_by.rs:21:5
41    |
42 LL |     vec.sort_unstable_by(|a, b| id(-b).cmp(&id(-a)));
43    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec.sort_unstable_by_key(|&b| Reverse(id(-b)))`
44
45 error: aborting due to 7 previous errors
46