@@ -78,35 +78,11 @@ help: or try being explicit about what type to clone
78
78
LL | let z: &Vec<_> = &std::vec::Vec<i32>::clone(y);
79
79
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
80
80
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:71:27
83
- |
84
- LL | let v2: Vec<isize> = v.iter().cloned().collect();
85
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()`
86
- |
87
- = note: `-D clippy::iter-cloned-collect` implied by `-D warnings`
88
-
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:76:38
91
- |
92
- LL | let _: Vec<isize> = vec![1, 2, 3].iter().cloned().collect();
93
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()`
94
-
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:81:24
97
- |
98
- LL | .to_bytes()
99
- | ________________________^
100
- LL | | .iter()
101
- LL | | .cloned()
102
- LL | | .collect();
103
- | |______________________^ help: try: `.to_vec()`
104
-
105
81
error: using `clone` on a `Copy` type
106
- --> $DIR/unnecessary_clone.rs:119 :20
82
+ --> $DIR/unnecessary_clone.rs:100 :20
107
83
|
108
84
LL | let _: E = a.clone();
109
85
| ^^^^^^^^^ help: try dereferencing it: `*****a`
110
86
111
- error: aborting due to 15 previous errors
87
+ error: aborting due to 12 previous errors
112
88
0 commit comments