@@ -19,51 +19,51 @@ LL | rc.borrow().clone();
1919 | ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*rc.borrow()`
2020
2121error: using '.clone()' on a ref-counted pointer
22- --> $DIR/unnecessary_clone.rs:34 :5
22+ --> $DIR/unnecessary_clone.rs:39 :5
2323 |
2424LL | rc.clone();
2525 | ^^^^^^^^^^ help: try this: `Rc::<bool>::clone(&rc)`
2626 |
2727 = note: `-D clippy::clone-on-ref-ptr` implied by `-D warnings`
2828
2929error: using '.clone()' on a ref-counted pointer
30- --> $DIR/unnecessary_clone.rs:37 :5
30+ --> $DIR/unnecessary_clone.rs:42 :5
3131 |
3232LL | arc.clone();
3333 | ^^^^^^^^^^^ help: try this: `Arc::<bool>::clone(&arc)`
3434
3535error: using '.clone()' on a ref-counted pointer
36- --> $DIR/unnecessary_clone.rs:40 :5
36+ --> $DIR/unnecessary_clone.rs:45 :5
3737 |
3838LL | rcweak.clone();
3939 | ^^^^^^^^^^^^^^ help: try this: `Weak::<bool>::clone(&rcweak)`
4040
4141error: using '.clone()' on a ref-counted pointer
42- --> $DIR/unnecessary_clone.rs:43 :5
42+ --> $DIR/unnecessary_clone.rs:48 :5
4343 |
4444LL | arc_weak.clone();
4545 | ^^^^^^^^^^^^^^^^ help: try this: `Weak::<bool>::clone(&arc_weak)`
4646
4747error: using '.clone()' on a ref-counted pointer
48- --> $DIR/unnecessary_clone.rs:47 :33
48+ --> $DIR/unnecessary_clone.rs:52 :33
4949 |
5050LL | let _: Arc<dyn SomeTrait> = x.clone();
5151 | ^^^^^^^^^ help: try this: `Arc::<SomeImpl>::clone(&x)`
5252
5353error: using `clone` on a `Copy` type
54- --> $DIR/unnecessary_clone.rs:51 :5
54+ --> $DIR/unnecessary_clone.rs:56 :5
5555 |
5656LL | t.clone();
5757 | ^^^^^^^^^ help: try removing the `clone` call: `t`
5858
5959error: using `clone` on a `Copy` type
60- --> $DIR/unnecessary_clone.rs:53 :5
60+ --> $DIR/unnecessary_clone.rs:58 :5
6161 |
6262LL | Some(t).clone();
6363 | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `Some(t)`
6464
6565error: using `clone` on a double-reference; this will copy the reference instead of cloning the inner type
66- --> $DIR/unnecessary_clone.rs:59 :22
66+ --> $DIR/unnecessary_clone.rs:64 :22
6767 |
6868LL | let z: &Vec<_> = y.clone();
6969 | ^^^^^^^^^
@@ -79,21 +79,21 @@ LL | let z: &Vec<_> = &std::vec::Vec<i32>::clone(y);
7979 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8080
8181error: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
82- --> $DIR/unnecessary_clone.rs:66 :27
82+ --> $DIR/unnecessary_clone.rs:71 :27
8383 |
8484LL | let v2: Vec<isize> = v.iter().cloned().collect();
8585 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()`
8686 |
8787 = note: `-D clippy::iter-cloned-collect` implied by `-D warnings`
8888
8989error: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
90- --> $DIR/unnecessary_clone.rs:71 :38
90+ --> $DIR/unnecessary_clone.rs:76 :38
9191 |
9292LL | let _: Vec<isize> = vec![1, 2, 3].iter().cloned().collect();
9393 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()`
9494
9595error: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
96- --> $DIR/unnecessary_clone.rs:76 :24
96+ --> $DIR/unnecessary_clone.rs:81 :24
9797 |
9898LL | .to_bytes()
9999 | ________________________^
@@ -103,7 +103,7 @@ LL | | .collect();
103103 | |______________________^ help: try: `.to_vec()`
104104
105105error: using `clone` on a `Copy` type
106- --> $DIR/unnecessary_clone.rs:114 :20
106+ --> $DIR/unnecessary_clone.rs:119 :20
107107 |
108108LL | let _: E = a.clone();
109109 | ^^^^^^^^^ help: try dereferencing it: `*****a`
0 commit comments