Skip to content

Commit

Permalink
[ needless_for_each ]: fix doc nits
Browse files Browse the repository at this point in the history
  • Loading branch information
bitfield committed Jun 6, 2024
1 parent 5e60afb commit 7ab4af3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clippy_lints/src/needless_for_each.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ declare_clippy_lint! {
/// ```no_run
/// let v = vec![0, 1, 2];
/// v.iter().for_each(|elem| {
/// println!("{}", elem);
/// println!("{elem}");
/// })
/// ```
/// Use instead:
/// ```no_run
/// let v = vec![0, 1, 2];
/// for elem in v.iter() {
/// println!("{}", elem);
/// for elem in &v {
/// println!("{elem}");
/// }
/// ```
///
Expand Down

0 comments on commit 7ab4af3

Please sign in to comment.