From 7a4d07105f58fdee2ee1d72826bfaa177b07fdb2 Mon Sep 17 00:00:00 2001 From: bing Date: Mon, 18 Apr 2022 14:42:24 +0800 Subject: [PATCH] Less authoritative stable_sort_primitive message --- clippy_lints/src/stable_sort_primitive.rs | 4 ++-- tests/ui/stable_sort_primitive.stderr | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/clippy_lints/src/stable_sort_primitive.rs b/clippy_lints/src/stable_sort_primitive.rs index bcd28b42978..a285323dc6e 100644 --- a/clippy_lints/src/stable_sort_primitive.rs +++ b/clippy_lints/src/stable_sort_primitive.rs @@ -30,7 +30,7 @@ /// ``` #[clippy::version = "1.47.0"] pub STABLE_SORT_PRIMITIVE, - perf, + pedantic, "use of sort() when sort_unstable() is equivalent" } @@ -126,7 +126,7 @@ fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { Applicability::MachineApplicable, ); diag.note( - "an unstable sort would perform faster without any observable difference for this data type", + "an unstable sort typically performs faster without any observable difference for this data type", ); }, ); diff --git a/tests/ui/stable_sort_primitive.stderr b/tests/ui/stable_sort_primitive.stderr index b8d22ed2504..c35e0c22ae8 100644 --- a/tests/ui/stable_sort_primitive.stderr +++ b/tests/ui/stable_sort_primitive.stderr @@ -5,7 +5,7 @@ LL | vec.sort(); | ^^^^^^^^^^ help: try: `vec.sort_unstable()` | = note: `-D clippy::stable-sort-primitive` implied by `-D warnings` - = note: an unstable sort would perform faster without any observable difference for this data type + = note: an unstable sort typically performs faster without any observable difference for this data type error: used `sort` on primitive type `bool` --> $DIR/stable_sort_primitive.rs:9:5 @@ -13,7 +13,7 @@ error: used `sort` on primitive type `bool` LL | vec.sort(); | ^^^^^^^^^^ help: try: `vec.sort_unstable()` | - = note: an unstable sort would perform faster without any observable difference for this data type + = note: an unstable sort typically performs faster without any observable difference for this data type error: used `sort` on primitive type `char` --> $DIR/stable_sort_primitive.rs:11:5 @@ -21,7 +21,7 @@ error: used `sort` on primitive type `char` LL | vec.sort(); | ^^^^^^^^^^ help: try: `vec.sort_unstable()` | - = note: an unstable sort would perform faster without any observable difference for this data type + = note: an unstable sort typically performs faster without any observable difference for this data type error: used `sort` on primitive type `str` --> $DIR/stable_sort_primitive.rs:13:5 @@ -29,7 +29,7 @@ error: used `sort` on primitive type `str` LL | vec.sort(); | ^^^^^^^^^^ help: try: `vec.sort_unstable()` | - = note: an unstable sort would perform faster without any observable difference for this data type + = note: an unstable sort typically performs faster without any observable difference for this data type error: used `sort` on primitive type `tuple` --> $DIR/stable_sort_primitive.rs:15:5 @@ -37,7 +37,7 @@ error: used `sort` on primitive type `tuple` LL | vec.sort(); | ^^^^^^^^^^ help: try: `vec.sort_unstable()` | - = note: an unstable sort would perform faster without any observable difference for this data type + = note: an unstable sort typically performs faster without any observable difference for this data type error: used `sort` on primitive type `array` --> $DIR/stable_sort_primitive.rs:17:5 @@ -45,7 +45,7 @@ error: used `sort` on primitive type `array` LL | vec.sort(); | ^^^^^^^^^^ help: try: `vec.sort_unstable()` | - = note: an unstable sort would perform faster without any observable difference for this data type + = note: an unstable sort typically performs faster without any observable difference for this data type error: used `sort` on primitive type `i32` --> $DIR/stable_sort_primitive.rs:19:5 @@ -53,7 +53,7 @@ error: used `sort` on primitive type `i32` LL | arr.sort(); | ^^^^^^^^^^ help: try: `arr.sort_unstable()` | - = note: an unstable sort would perform faster without any observable difference for this data type + = note: an unstable sort typically performs faster without any observable difference for this data type error: aborting due to 7 previous errors -- 2.44.0