File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -889,6 +889,10 @@ declare_clippy_lint! {
889889 /// ```rust
890890 /// let _ = [1, 2, 3].into_iter().map(|x| *x).collect::<Vec<u32>>();
891891 /// ```
892+ /// Could be written as:
893+ /// ```rust
894+ /// let _ = [1, 2, 3].iter().map(|x| *x).collect::<Vec<u32>>();
895+ /// ```
892896 pub INTO_ITER_ON_ARRAY ,
893897 correctness,
894898 "using `.into_iter()` on an array"
Original file line number Diff line number Diff line change @@ -52,6 +52,12 @@ declare_clippy_lint! {
5252 /// a = b;
5353 /// b = a;
5454 /// ```
55+ /// Could be written as:
56+ /// ```rust
57+ /// # let mut a = 1;
58+ /// # let mut b = 2;
59+ /// std::mem::swap(&mut a, &mut b);
60+ /// ```
5561 pub ALMOST_SWAPPED ,
5662 correctness,
5763 "`foo = bar; bar = foo` sequence"
You can’t perform that action at this time.
0 commit comments