Skip to content

Commit

Permalink
reword limitation section
Browse files Browse the repository at this point in the history
  • Loading branch information
y21 committed Oct 28, 2023
1 parent 45f94c7 commit 9a10d32
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions clippy_lints/src/iter_without_into_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ declare_clippy_lint! {
/// (`for val in &iter {}`), without having to first call `iter()` or `iter_mut()`.
///
/// ### Limitations
/// This lint is restricted to exported types only, because it is aimed at guiding towards an
/// idiomatic, _public_ API.
/// Implementing the `IntoIterator` trait when it is not needed or used anywhere doesn't help or improve the code.
/// This lint focuses on providing an idiomatic API. Therefore, it will only
/// lint on types which are accessible outside of the crate. For internal types,
/// the `IntoIterator` trait can be implemented on demand if it is actually needed.
///
/// ### Example
/// ```rust
Expand Down Expand Up @@ -67,10 +67,12 @@ declare_clippy_lint! {
/// in case of ambiguity with another `IntoIterator` impl.
///
/// ### Limitations
/// This lint is restricted to exported types only, because it is aimed at guiding towards an
/// idiomatic, _public_ API.
/// Adding an `iter` or `iter_mut` for private types when it is not needed or used doesn't improve code,
/// and in fact, is linted against by the `dead_code` lint.
/// This lint focuses on providing an idiomatic API. Therefore, it will only
/// lint on types which are accessible outside of the crate. For internal types,
/// these methods can be added on demand if they are actually needed. Otherwise,
/// it would trigger the [`dead_code`] lint for the unused method.
///
/// [`dead_code`]: https://doc.rust-lang.org/rustc/lints/listing/warn-by-default.html#dead-code
///
/// ### Example
/// ```rust
Expand Down

0 comments on commit 9a10d32

Please sign in to comment.