Skip to content

Commit 2e597e2

Browse files
committed
Change a category of excessive_for_each: Style -> Restriction
1 parent 6725319 commit 2e597e2

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
@@ -1307,6 +1307,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
13071307
LintId::of(&matches::WILDCARD_ENUM_MATCH_ARM),
13081308
LintId::of(&mem_forget::MEM_FORGET),
13091309
LintId::of(&methods::CLONE_ON_REF_PTR),
1310+
LintId::of(&methods::EXCESSIVE_FOR_EACH),
13101311
LintId::of(&methods::EXPECT_USED),
13111312
LintId::of(&methods::FILETYPE_IS_FILE),
13121313
LintId::of(&methods::GET_UNWRAP),
@@ -1568,7 +1569,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
15681569
LintId::of(&methods::CHARS_NEXT_CMP),
15691570
LintId::of(&methods::CLONE_DOUBLE_REF),
15701571
LintId::of(&methods::CLONE_ON_COPY),
1571-
LintId::of(&methods::EXCESSIVE_FOR_EACH),
15721572
LintId::of(&methods::EXPECT_FUN_CALL),
15731573
LintId::of(&methods::FILTER_MAP_IDENTITY),
15741574
LintId::of(&methods::FILTER_NEXT),
@@ -1787,7 +1787,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
17871787
LintId::of(&methods::BYTES_NTH),
17881788
LintId::of(&methods::CHARS_LAST_CMP),
17891789
LintId::of(&methods::CHARS_NEXT_CMP),
1790-
LintId::of(&methods::EXCESSIVE_FOR_EACH),
17911790
LintId::of(&methods::FROM_ITER_INSTEAD_OF_COLLECT),
17921791
LintId::of(&methods::INTO_ITER_ON_REF),
17931792
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
@@ -952,7 +952,7 @@ declare_clippy_lint! {
952952
/// }
953953
/// ```
954954
pub EXCESSIVE_FOR_EACH,
955-
style,
955+
restriction,
956956
"using `.iter().for_each(|x| {..})` when using `for` loop would work instead"
957957
}
958958

0 commit comments

Comments
 (0)