]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/needless_collect.stderr
Merge commit '9809f5d21990d9e24b3e9876ea7da756fd4e9def' into libgccjit-codegen
[rust.git] / src / tools / clippy / tests / ui / needless_collect.stderr
1 error: avoid using `collect()` when not needed
2   --> $DIR/needless_collect.rs:11:29
3    |
4 LL |     let len = sample.iter().collect::<Vec<_>>().len();
5    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `count()`
6    |
7    = note: `-D clippy::needless-collect` implied by `-D warnings`
8
9 error: avoid using `collect()` when not needed
10   --> $DIR/needless_collect.rs:12:22
11    |
12 LL |     if sample.iter().collect::<Vec<_>>().is_empty() {
13    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `next().is_none()`
14
15 error: avoid using `collect()` when not needed
16   --> $DIR/needless_collect.rs:15:28
17    |
18 LL |     sample.iter().cloned().collect::<Vec<_>>().contains(&1);
19    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `any(|x| x == 1)`
20
21 error: avoid using `collect()` when not needed
22   --> $DIR/needless_collect.rs:20:35
23    |
24 LL |     sample.iter().map(|x| (x, x)).collect::<HashMap<_, _>>().is_empty();
25    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `next().is_none()`
26
27 error: avoid using `collect()` when not needed
28   --> $DIR/needless_collect.rs:21:35
29    |
30 LL |     sample.iter().map(|x| (x, x)).collect::<BTreeMap<_, _>>().is_empty();
31    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `next().is_none()`
32
33 error: avoid using `collect()` when not needed
34   --> $DIR/needless_collect.rs:28:19
35    |
36 LL |     sample.iter().collect::<LinkedList<_>>().len();
37    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `count()`
38
39 error: avoid using `collect()` when not needed
40   --> $DIR/needless_collect.rs:29:19
41    |
42 LL |     sample.iter().collect::<LinkedList<_>>().is_empty();
43    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `next().is_none()`
44
45 error: avoid using `collect()` when not needed
46   --> $DIR/needless_collect.rs:30:28
47    |
48 LL |     sample.iter().cloned().collect::<LinkedList<_>>().contains(&1);
49    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `any(|x| x == 1)`
50
51 error: avoid using `collect()` when not needed
52   --> $DIR/needless_collect.rs:31:19
53    |
54 LL |     sample.iter().collect::<LinkedList<_>>().contains(&&1);
55    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `any(|x| x == &1)`
56
57 error: avoid using `collect()` when not needed
58   --> $DIR/needless_collect.rs:34:19
59    |
60 LL |     sample.iter().collect::<BinaryHeap<_>>().len();
61    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `count()`
62
63 error: avoid using `collect()` when not needed
64   --> $DIR/needless_collect.rs:35:19
65    |
66 LL |     sample.iter().collect::<BinaryHeap<_>>().is_empty();
67    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `next().is_none()`
68
69 error: aborting due to 11 previous errors
70