Skip to content

Commit a5d296a

Browse files
committed
iter conservation efforts: save the endangered .iter() and .into_iter()
Make explicit_iter_loop and explicit_into_iter_loop allow-by-default, so that people can turn them on if they want to enforce that style; avoid presenting them as *the* idiomatic Rust style, rather than just *a* style.
1 parent 2b7a530 commit a5d296a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clippy_lints/src/loops.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ declare_clippy_lint! {
8585
/// ```
8686
declare_clippy_lint! {
8787
pub EXPLICIT_ITER_LOOP,
88-
style,
88+
pedantic,
8989
"for-looping over `_.iter()` or `_.iter_mut()` when `&_` or `&mut _` would do"
9090
}
9191

@@ -107,7 +107,7 @@ declare_clippy_lint! {
107107
/// ```
108108
declare_clippy_lint! {
109109
pub EXPLICIT_INTO_ITER_LOOP,
110-
style,
110+
pedantic,
111111
"for-looping over `_.into_iter()` when `_` would do"
112112
}
113113

@@ -1209,7 +1209,7 @@ fn lint_iter_method(cx: &LateContext<'_, '_>, args: &[Expr], arg: &Expr, method_
12091209
cx,
12101210
EXPLICIT_ITER_LOOP,
12111211
arg.span,
1212-
"it is more idiomatic to loop over references to containers instead of using explicit \
1212+
"it is more concise to loop over references to containers instead of using explicit \
12131213
iteration methods",
12141214
"to write this more concisely, try",
12151215
format!("&{}{}", muta, object),
@@ -1247,7 +1247,7 @@ fn check_for_loop_arg(cx: &LateContext<'_, '_>, pat: &Pat, arg: &Expr, expr: &Ex
12471247
cx,
12481248
EXPLICIT_INTO_ITER_LOOP,
12491249
arg.span,
1250-
"it is more idiomatic to loop over containers instead of using explicit \
1250+
"it is more concise to loop over containers instead of using explicit \
12511251
iteration methods`",
12521252
"to write this more concisely, try",
12531253
object.to_string(),

0 commit comments

Comments
 (0)