Skip to content

Commit 54a0471

Browse files
committed
Change a category of excessive_for_each: Style -> Restriction
1 parent 3095253 commit 54a0471

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

clippy_lints/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,6 +1314,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
13141314
LintId::of(&matches::WILDCARD_ENUM_MATCH_ARM),
13151315
LintId::of(&mem_forget::MEM_FORGET),
13161316
LintId::of(&methods::CLONE_ON_REF_PTR),
1317+
LintId::of(&methods::EXCESSIVE_FOR_EACH),
13171318
LintId::of(&methods::EXPECT_USED),
13181319
LintId::of(&methods::FILETYPE_IS_FILE),
13191320
LintId::of(&methods::GET_UNWRAP),
@@ -1582,7 +1583,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
15821583
LintId::of(&methods::CHARS_NEXT_CMP),
15831584
LintId::of(&methods::CLONE_DOUBLE_REF),
15841585
LintId::of(&methods::CLONE_ON_COPY),
1585-
LintId::of(&methods::EXCESSIVE_FOR_EACH),
15861586
LintId::of(&methods::EXPECT_FUN_CALL),
15871587
LintId::of(&methods::FILTER_MAP_IDENTITY),
15881588
LintId::of(&methods::FILTER_NEXT),
@@ -1799,7 +1799,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
17991799
LintId::of(&methods::BYTES_NTH),
18001800
LintId::of(&methods::CHARS_LAST_CMP),
18011801
LintId::of(&methods::CHARS_NEXT_CMP),
1802-
LintId::of(&methods::EXCESSIVE_FOR_EACH),
18031802
LintId::of(&methods::FROM_ITER_INSTEAD_OF_COLLECT),
18041803
LintId::of(&methods::INTO_ITER_ON_REF),
18051804
LintId::of(&methods::ITER_CLONED_COLLECT),

clippy_lints/src/methods/excessive_for_each.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ pub(super) fn lint(cx: &LateContext<'_>, expr: &'tcx Expr<'_>, args: &[&[Expr<'_
2626

2727
if_chain! {
2828
if match_trait_method(cx, expr, &paths::ITERATOR);
29-
if !match_trait_method(cx, for_each_receiver, &paths::ITERATOR);
3029
if is_target_ty(cx, cx.typeck_results().expr_ty(iter_receiver));
3130
if let ExprKind::Closure(_, _, body_id, ..) = for_each_arg.kind;
3231
then {

clippy_lints/src/methods/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ declare_clippy_lint! {
997997
/// }
998998
/// ```
999999
pub EXCESSIVE_FOR_EACH,
1000-
style,
1000+
restriction,
10011001
"using `.iter().for_each(|x| {..})` when using `for` loop would work instead"
10021002
}
10031003

0 commit comments

Comments
 (0)