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! {
889
889
/// ```rust
890
890
/// let _ = [1, 2, 3].into_iter().map(|x| *x).collect::<Vec<u32>>();
891
891
/// ```
892
+ /// Could be written as:
893
+ /// ```rust
894
+ /// let _ = [1, 2, 3].iter().map(|x| *x).collect::<Vec<u32>>();
895
+ /// ```
892
896
pub INTO_ITER_ON_ARRAY ,
893
897
correctness,
894
898
"using `.into_iter()` on an array"
Original file line number Diff line number Diff line change @@ -52,6 +52,12 @@ declare_clippy_lint! {
52
52
/// a = b;
53
53
/// b = a;
54
54
/// ```
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
+ /// ```
55
61
pub ALMOST_SWAPPED ,
56
62
correctness,
57
63
"`foo = bar; bar = foo` sequence"
You can’t perform that action at this time.
0 commit comments