File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,11 @@ declare_clippy_lint! {
19
19
/// It's not bad, but having them is idiomatic and allows the type to be used in for loops directly
20
20
/// (`for val in &iter {}`), without having to first call `iter()` or `iter_mut()`.
21
21
///
22
+ /// ### Limitations
23
+ /// This lint is restricted to exported types only, because it is aimed at guiding towards an
24
+ /// idiomatic, _public_ API.
25
+ /// Implementing the `IntoIterator` trait when it is not needed or used anywhere doesn't help or improve the code.
26
+ ///
22
27
/// ### Example
23
28
/// ```rust
24
29
/// struct MySlice<'a>(&'a [u8]);
@@ -61,6 +66,12 @@ declare_clippy_lint! {
61
66
/// by just calling `.iter()`, instead of the more awkward `<&Type>::into_iter` or `(&val).into_iter()` syntax
62
67
/// in case of ambiguity with another `IntoIterator` impl.
63
68
///
69
+ /// ### Limitations
70
+ /// This lint is restricted to exported types only, because it is aimed at guiding towards an
71
+ /// idiomatic, _public_ API.
72
+ /// Adding an `iter` or `iter_mut` for private types when it is not needed or used doesn't improve code,
73
+ /// and in fact, is linted against by the `dead_code` lint.
74
+ ///
64
75
/// ### Example
65
76
/// ```rust
66
77
/// struct MySlice<'a>(&'a [u8]);
You can’t perform that action at this time.
0 commit comments