1 error: avoid using `collect()` when not needed
2 --> $DIR/needless_collect.rs:11:29
4 LL | let len = sample.iter().collect::<Vec<_>>().len();
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `count()`
7 = note: `-D clippy::needless-collect` implied by `-D warnings`
9 error: avoid using `collect()` when not needed
10 --> $DIR/needless_collect.rs:12:22
12 LL | if sample.iter().collect::<Vec<_>>().is_empty() {
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `next().is_none()`
15 error: avoid using `collect()` when not needed
16 --> $DIR/needless_collect.rs:15:28
18 LL | sample.iter().cloned().collect::<Vec<_>>().contains(&1);
19 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `any(|x| x == 1)`
21 error: avoid using `collect()` when not needed
22 --> $DIR/needless_collect.rs:20:35
24 LL | sample.iter().map(|x| (x, x)).collect::<HashMap<_, _>>().is_empty();
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `next().is_none()`
27 error: avoid using `collect()` when not needed
28 --> $DIR/needless_collect.rs:21:35
30 LL | sample.iter().map(|x| (x, x)).collect::<BTreeMap<_, _>>().is_empty();
31 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `next().is_none()`
33 error: avoid using `collect()` when not needed
34 --> $DIR/needless_collect.rs:28:19
36 LL | sample.iter().collect::<LinkedList<_>>().len();
37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `count()`
39 error: avoid using `collect()` when not needed
40 --> $DIR/needless_collect.rs:29:19
42 LL | sample.iter().collect::<LinkedList<_>>().is_empty();
43 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `next().is_none()`
45 error: avoid using `collect()` when not needed
46 --> $DIR/needless_collect.rs:30:28
48 LL | sample.iter().cloned().collect::<LinkedList<_>>().contains(&1);
49 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `any(|x| x == 1)`
51 error: avoid using `collect()` when not needed
52 --> $DIR/needless_collect.rs:31:19
54 LL | sample.iter().collect::<LinkedList<_>>().contains(&&1);
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `any(|x| x == &1)`
57 error: avoid using `collect()` when not needed
58 --> $DIR/needless_collect.rs:34:19
60 LL | sample.iter().collect::<BinaryHeap<_>>().len();
61 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `count()`
63 error: avoid using `collect()` when not needed
64 --> $DIR/needless_collect.rs:35:19
66 LL | sample.iter().collect::<BinaryHeap<_>>().is_empty();
67 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `next().is_none()`
69 error: aborting due to 11 previous errors