Skip to content

Commit 015ab9f

Browse files
committed
Renamed to
1 parent 07886a9 commit 015ab9f

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

clippy_lints/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ mod serde_api;
304304
mod shadow;
305305
mod single_component_path_imports;
306306
mod slow_vector_initialization;
307-
mod sort_by_key;
307+
mod unnecessary_sort_by;
308308
mod strings;
309309
mod suspicious_trait_impl;
310310
mod swap;
@@ -780,7 +780,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
780780
&shadow::SHADOW_UNRELATED,
781781
&single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS,
782782
&slow_vector_initialization::SLOW_VECTOR_INITIALIZATION,
783-
&sort_by_key::SORT_BY_KEY,
783+
&unnecessary_sort_by::UNNECESSARY_SORT_BY,
784784
&strings::STRING_ADD,
785785
&strings::STRING_ADD_ASSIGN,
786786
&strings::STRING_LIT_AS_BYTES,
@@ -998,7 +998,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
998998
store.register_late_pass(|| box ptr_offset_with_cast::PtrOffsetWithCast);
999999
store.register_late_pass(|| box redundant_clone::RedundantClone);
10001000
store.register_late_pass(|| box slow_vector_initialization::SlowVectorInit);
1001-
store.register_late_pass(|| box sort_by_key::SortByKey);
1001+
store.register_late_pass(|| box unnecessary_sort_by::UnnecessarySortBy);
10021002
store.register_late_pass(|| box types::RefToMut);
10031003
store.register_late_pass(|| box assertions_on_constants::AssertionsOnConstants);
10041004
store.register_late_pass(|| box missing_const_for_fn::MissingConstForFn);
@@ -1394,7 +1394,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
13941394
LintId::of(&serde_api::SERDE_API_MISUSE),
13951395
LintId::of(&single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS),
13961396
LintId::of(&slow_vector_initialization::SLOW_VECTOR_INITIALIZATION),
1397-
LintId::of(&sort_by_key::SORT_BY_KEY),
1397+
LintId::of(&unnecessary_sort_by::UNNECESSARY_SORT_BY),
13981398
LintId::of(&strings::STRING_LIT_AS_BYTES),
13991399
LintId::of(&suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL),
14001400
LintId::of(&suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL),
@@ -1596,7 +1596,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
15961596
LintId::of(&ranges::RANGE_ZIP_WITH_LEN),
15971597
LintId::of(&reference::DEREF_ADDROF),
15981598
LintId::of(&reference::REF_IN_DEREF),
1599-
LintId::of(&sort_by_key::SORT_BY_KEY),
1599+
LintId::of(&unnecessary_sort_by::UNNECESSARY_SORT_BY),
16001600
LintId::of(&swap::MANUAL_SWAP),
16011601
LintId::of(&temporary_assignment::TEMPORARY_ASSIGNMENT),
16021602
LintId::of(&transmute::CROSSPOINTER_TRANSMUTE),

clippy_lints/src/sort_by_key.rs renamed to clippy_lints/src/unnecessary_sort_by.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ declare_clippy_lint! {
1414
/// which compares the two arguments, either directly or indirectly.
1515
///
1616
/// **Why is this bad?**
17-
/// It is more clear to use `Vec::sort_by_key` (or
18-
/// `Vec::sort_by_key` and `std::cmp::Reverse` if necessary) than
19-
/// using
17+
/// It is more clear to use `Vec::sort_by_key` (or `Vec::sort` if
18+
/// possible) than to use `Vec::sort_by` and and a more complicated
19+
/// closure.
2020
///
2121
/// **Known problems:** None.
2222
///
@@ -29,12 +29,12 @@ declare_clippy_lint! {
2929
/// ```rust
3030
/// vec.sort_by_key(|a| a.foo());
3131
/// ```
32-
pub SORT_BY_KEY,
32+
pub UNNECESSARY_SORT_BY,
3333
complexity,
34-
"Use of `Vec::sort_by` when `Vec::sort_by_key` would be clearer"
34+
"Use of `Vec::sort_by` when `Vec::sort_by_key` or `Vec::sort` would be clearer"
3535
}
3636

37-
declare_lint_pass!(SortByKey => [SORT_BY_KEY]);
37+
declare_lint_pass!(UnnecessarySortBy => [UNNECESSARY_SORT_BY]);
3838

3939
enum LintTrigger {
4040
Sort(SortDetection),
@@ -205,12 +205,12 @@ fn detect_lint(cx: &LateContext<'_, '_>, expr: &Expr<'_>) -> Option<LintTrigger>
205205
}
206206
}
207207

208-
impl LateLintPass<'_, '_> for SortByKey {
208+
impl LateLintPass<'_, '_> for UnnecessarySortBy {
209209
fn check_expr(&mut self, cx: &LateContext<'_, '_>, expr: &Expr<'_>) {
210210
match detect_lint(cx, expr) {
211211
Some(LintTrigger::SortByKey(trigger)) => utils::span_lint_and_sugg(
212212
cx,
213-
SORT_BY_KEY,
213+
UNNECESSARY_SORT_BY,
214214
expr.span,
215215
"use Vec::sort_by_key here instead",
216216
"try",
@@ -225,7 +225,7 @@ impl LateLintPass<'_, '_> for SortByKey {
225225
),
226226
Some(LintTrigger::Sort(trigger)) => utils::span_lint_and_sugg(
227227
cx,
228-
SORT_BY_KEY,
228+
UNNECESSARY_SORT_BY,
229229
expr.span,
230230
"use Vec::sort here instead",
231231
"try",
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)