2019-09-25 12:46:14 -05:00
|
|
|
error: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/iter_cloned_collect.rs:8:27
|
2019-09-25 12:46:14 -05:00
|
|
|
|
|
|
|
|
LL | let v2: Vec<isize> = v.iter().cloned().collect();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::iter-cloned-collect` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::iter_cloned_collect)]`
|
2019-09-25 12:46:14 -05:00
|
|
|
|
|
|
|
error: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/iter_cloned_collect.rs:13:38
|
2019-09-25 12:46:14 -05:00
|
|
|
|
|
|
|
|
LL | let _: Vec<isize> = vec![1, 2, 3].iter().cloned().collect();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()`
|
|
|
|
|
|
|
|
error: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/iter_cloned_collect.rs:18:24
|
2019-09-25 12:46:14 -05:00
|
|
|
|
|
|
|
|
LL | .to_bytes()
|
|
|
|
| ________________________^
|
|
|
|
LL | | .iter()
|
|
|
|
LL | | .cloned()
|
|
|
|
LL | | .collect();
|
|
|
|
| |______________________^ help: try: `.to_vec()`
|
|
|
|
|
2021-04-27 09:55:11 -05:00
|
|
|
error: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/iter_cloned_collect.rs:26:24
|
2021-04-27 09:55:11 -05:00
|
|
|
|
|
|
|
|
LL | let _: Vec<_> = arr.iter().cloned().collect();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()`
|
|
|
|
|
2021-12-06 05:33:31 -06:00
|
|
|
error: called `iter().copied().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/iter_cloned_collect.rs:29:26
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let _: Vec<isize> = v.iter().copied().collect();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()`
|
|
|
|
|
|
|
|
error: aborting due to 5 previous errors
|
2019-09-25 12:46:14 -05:00
|
|
|
|