@@ -19,51 +19,51 @@ LL | rc.borrow().clone();
19
19
| ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*rc.borrow()`
20
20
21
21
error: using '.clone()' on a ref-counted pointer
22
- --> $DIR/unnecessary_clone.rs:34 :5
22
+ --> $DIR/unnecessary_clone.rs:39 :5
23
23
|
24
24
LL | rc.clone();
25
25
| ^^^^^^^^^^ help: try this: `Rc::<bool>::clone(&rc)`
26
26
|
27
27
= note: `-D clippy::clone-on-ref-ptr` implied by `-D warnings`
28
28
29
29
error: using '.clone()' on a ref-counted pointer
30
- --> $DIR/unnecessary_clone.rs:37 :5
30
+ --> $DIR/unnecessary_clone.rs:42 :5
31
31
|
32
32
LL | arc.clone();
33
33
| ^^^^^^^^^^^ help: try this: `Arc::<bool>::clone(&arc)`
34
34
35
35
error: using '.clone()' on a ref-counted pointer
36
- --> $DIR/unnecessary_clone.rs:40 :5
36
+ --> $DIR/unnecessary_clone.rs:45 :5
37
37
|
38
38
LL | rcweak.clone();
39
39
| ^^^^^^^^^^^^^^ help: try this: `Weak::<bool>::clone(&rcweak)`
40
40
41
41
error: using '.clone()' on a ref-counted pointer
42
- --> $DIR/unnecessary_clone.rs:43 :5
42
+ --> $DIR/unnecessary_clone.rs:48 :5
43
43
|
44
44
LL | arc_weak.clone();
45
45
| ^^^^^^^^^^^^^^^^ help: try this: `Weak::<bool>::clone(&arc_weak)`
46
46
47
47
error: using '.clone()' on a ref-counted pointer
48
- --> $DIR/unnecessary_clone.rs:47 :33
48
+ --> $DIR/unnecessary_clone.rs:52 :33
49
49
|
50
50
LL | let _: Arc<dyn SomeTrait> = x.clone();
51
51
| ^^^^^^^^^ help: try this: `Arc::<SomeImpl>::clone(&x)`
52
52
53
53
error: using `clone` on a `Copy` type
54
- --> $DIR/unnecessary_clone.rs:51 :5
54
+ --> $DIR/unnecessary_clone.rs:56 :5
55
55
|
56
56
LL | t.clone();
57
57
| ^^^^^^^^^ help: try removing the `clone` call: `t`
58
58
59
59
error: using `clone` on a `Copy` type
60
- --> $DIR/unnecessary_clone.rs:53 :5
60
+ --> $DIR/unnecessary_clone.rs:58 :5
61
61
|
62
62
LL | Some(t).clone();
63
63
| ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `Some(t)`
64
64
65
65
error: 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
67
67
|
68
68
LL | let z: &Vec<_> = y.clone();
69
69
| ^^^^^^^^^
@@ -79,21 +79,21 @@ LL | let z: &Vec<_> = &std::vec::Vec<i32>::clone(y);
79
79
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
80
80
81
81
error: 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
83
83
|
84
84
LL | let v2: Vec<isize> = v.iter().cloned().collect();
85
85
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()`
86
86
|
87
87
= note: `-D clippy::iter-cloned-collect` implied by `-D warnings`
88
88
89
89
error: 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
91
91
|
92
92
LL | let _: Vec<isize> = vec![1, 2, 3].iter().cloned().collect();
93
93
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()`
94
94
95
95
error: 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
97
97
|
98
98
LL | .to_bytes()
99
99
| ________________________^
@@ -103,7 +103,7 @@ LL | | .collect();
103
103
| |______________________^ help: try: `.to_vec()`
104
104
105
105
error: using `clone` on a `Copy` type
106
- --> $DIR/unnecessary_clone.rs:114 :20
106
+ --> $DIR/unnecessary_clone.rs:119 :20
107
107
|
108
108
LL | let _: E = a.clone();
109
109
| ^^^^^^^^^ help: try dereferencing it: `*****a`
0 commit comments