Skip to content

Commit 9a10d32

Browse files
committed
reword limitation section
1 parent 45f94c7 commit 9a10d32

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

clippy_lints/src/iter_without_into_iter.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ declare_clippy_lint! {
2020
/// (`for val in &iter {}`), without having to first call `iter()` or `iter_mut()`.
2121
///
2222
/// ### 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.
23+
/// This lint focuses on providing an idiomatic API. Therefore, it will only
24+
/// lint on types which are accessible outside of the crate. For internal types,
25+
/// the `IntoIterator` trait can be implemented on demand if it is actually needed.
2626
///
2727
/// ### Example
2828
/// ```rust
@@ -67,10 +67,12 @@ declare_clippy_lint! {
6767
/// in case of ambiguity with another `IntoIterator` impl.
6868
///
6969
/// ### 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.
70+
/// This lint focuses on providing an idiomatic API. Therefore, it will only
71+
/// lint on types which are accessible outside of the crate. For internal types,
72+
/// these methods can be added on demand if they are actually needed. Otherwise,
73+
/// it would trigger the [`dead_code`] lint for the unused method.
74+
///
75+
/// [`dead_code`]: https://doc.rust-lang.org/rustc/lints/listing/warn-by-default.html#dead-code
7476
///
7577
/// ### Example
7678
/// ```rust

0 commit comments

Comments
 (0)