Skip to content

Commit 83559b8

Browse files
committed
Update lint description for avoidable_slice_indexing
1 parent 26419e6 commit 83559b8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clippy_lints/src/avoidable_slice_indexing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ declare_clippy_lint! {
4646
/// ```
4747
pub AVOIDABLE_SLICE_INDEXING,
4848
pedantic,
49-
"default lint description"
49+
"avoid indexing on slices which could be deconstructed"
5050
}
5151

5252
#[derive(Copy, Clone)]
@@ -96,7 +96,7 @@ fn find_slice_values(cx: &LateContext<'_>, pat: &hir::Pat<'_>) -> Option<FxHashM
9696
if let hir::BindingAnnotation::Mutable | hir::BindingAnnotation::RefMut = binding {
9797
return;
9898
}
99-
99+
100100
// This block catches bindings with sub patterns. It would be hard to build a correct suggestion
101101
// for them and it's likely that the user knows what they are doing in such a case.
102102
if removed_pat.contains(&ident.name) {

clippy_lints/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
547547
attrs::INLINE_ALWAYS,
548548
attrs::MISMATCHED_TARGET_OS,
549549
attrs::USELESS_ATTRIBUTE,
550+
avoidable_slice_indexing::AVOIDABLE_SLICE_INDEXING,
550551
await_holding_invalid::AWAIT_HOLDING_LOCK,
551552
await_holding_invalid::AWAIT_HOLDING_REFCELL_REF,
552553
bit_mask::BAD_BIT_MASK,
@@ -918,7 +919,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
918919
shadow::SHADOW_UNRELATED,
919920
single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS,
920921
size_of_in_element_count::SIZE_OF_IN_ELEMENT_COUNT,
921-
avoidable_slice_indexing::AVOIDABLE_SLICE_INDEXING,
922922
slow_vector_initialization::SLOW_VECTOR_INITIALIZATION,
923923
stable_sort_primitive::STABLE_SORT_PRIMITIVE,
924924
strings::STRING_ADD,
@@ -1070,6 +1070,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
10701070

10711071
store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), vec![
10721072
LintId::of(attrs::INLINE_ALWAYS),
1073+
LintId::of(avoidable_slice_indexing::AVOIDABLE_SLICE_INDEXING),
10731074
LintId::of(await_holding_invalid::AWAIT_HOLDING_LOCK),
10741075
LintId::of(await_holding_invalid::AWAIT_HOLDING_REFCELL_REF),
10751076
LintId::of(bit_mask::VERBOSE_BIT_MASK),
@@ -1145,7 +1146,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
11451146
LintId::of(ref_option_ref::REF_OPTION_REF),
11461147
LintId::of(semicolon_if_nothing_returned::SEMICOLON_IF_NOTHING_RETURNED),
11471148
LintId::of(shadow::SHADOW_UNRELATED),
1148-
LintId::of(avoidable_slice_indexing::AVOIDABLE_SLICE_INDEXING),
11491149
LintId::of(strings::STRING_ADD_ASSIGN),
11501150
LintId::of(trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS),
11511151
LintId::of(trait_bounds::TYPE_REPETITION_IN_BOUNDS),

0 commit comments

Comments
 (0)