Skip to content

Commit 0e48a8f

Browse files
committed
Change a category of excessive_for_each: Style -> Restriction
1 parent 9a701ca commit 0e48a8f

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
@@ -1281,6 +1281,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
12811281
LintId::of(&matches::WILDCARD_ENUM_MATCH_ARM),
12821282
LintId::of(&mem_forget::MEM_FORGET),
12831283
LintId::of(&methods::CLONE_ON_REF_PTR),
1284+
LintId::of(&methods::EXCESSIVE_FOR_EACH),
12841285
LintId::of(&methods::EXPECT_USED),
12851286
LintId::of(&methods::FILETYPE_IS_FILE),
12861287
LintId::of(&methods::GET_UNWRAP),
@@ -1538,7 +1539,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
15381539
LintId::of(&methods::CHARS_NEXT_CMP),
15391540
LintId::of(&methods::CLONE_DOUBLE_REF),
15401541
LintId::of(&methods::CLONE_ON_COPY),
1541-
LintId::of(&methods::EXCESSIVE_FOR_EACH),
15421542
LintId::of(&methods::EXPECT_FUN_CALL),
15431543
LintId::of(&methods::FILTER_MAP_IDENTITY),
15441544
LintId::of(&methods::FILTER_NEXT),
@@ -1755,7 +1755,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
17551755
LintId::of(&methods::BYTES_NTH),
17561756
LintId::of(&methods::CHARS_LAST_CMP),
17571757
LintId::of(&methods::CHARS_NEXT_CMP),
1758-
LintId::of(&methods::EXCESSIVE_FOR_EACH),
17591758
LintId::of(&methods::FROM_ITER_INSTEAD_OF_COLLECT),
17601759
LintId::of(&methods::INTO_ITER_ON_REF),
17611760
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)