]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/manual_retain.stderr
Rollup merge of #102072 - scottmcm:ptr-alignment-type, r=thomcc
[rust.git] / src / tools / clippy / tests / ui / manual_retain.stderr
1 error: this expression can be written more simply using `.retain()`
2   --> $DIR/manual_retain.rs:52:5
3    |
4 LL |     btree_map = btree_map.into_iter().filter(|(k, _)| k % 2 == 0).collect();
5    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_map.retain(|k, _| k % 2 == 0)`
6    |
7    = note: `-D clippy::manual-retain` implied by `-D warnings`
8
9 error: this expression can be written more simply using `.retain()`
10   --> $DIR/manual_retain.rs:53:5
11    |
12 LL |     btree_map = btree_map.into_iter().filter(|(_, v)| v % 2 == 0).collect();
13    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_map.retain(|_, &mut v| v % 2 == 0)`
14
15 error: this expression can be written more simply using `.retain()`
16   --> $DIR/manual_retain.rs:54:5
17    |
18 LL | /     btree_map = btree_map
19 LL | |         .into_iter()
20 LL | |         .filter(|(k, v)| (k % 2 == 0) && (v % 2 == 0))
21 LL | |         .collect();
22    | |__________________^ help: consider calling `.retain()` instead: `btree_map.retain(|k, &mut v| (k % 2 == 0) && (v % 2 == 0))`
23
24 error: this expression can be written more simply using `.retain()`
25   --> $DIR/manual_retain.rs:76:5
26    |
27 LL |     btree_set = btree_set.iter().filter(|&x| x % 2 == 0).copied().collect();
28    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
29
30 error: this expression can be written more simply using `.retain()`
31   --> $DIR/manual_retain.rs:77:5
32    |
33 LL |     btree_set = btree_set.iter().filter(|&x| x % 2 == 0).cloned().collect();
34    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
35
36 error: this expression can be written more simply using `.retain()`
37   --> $DIR/manual_retain.rs:78:5
38    |
39 LL |     btree_set = btree_set.into_iter().filter(|x| x % 2 == 0).collect();
40    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
41
42 error: this expression can be written more simply using `.retain()`
43   --> $DIR/manual_retain.rs:108:5
44    |
45 LL |     hash_map = hash_map.into_iter().filter(|(k, _)| k % 2 == 0).collect();
46    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_map.retain(|k, _| k % 2 == 0)`
47
48 error: this expression can be written more simply using `.retain()`
49   --> $DIR/manual_retain.rs:109:5
50    |
51 LL |     hash_map = hash_map.into_iter().filter(|(_, v)| v % 2 == 0).collect();
52    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_map.retain(|_, &mut v| v % 2 == 0)`
53
54 error: this expression can be written more simply using `.retain()`
55   --> $DIR/manual_retain.rs:110:5
56    |
57 LL | /     hash_map = hash_map
58 LL | |         .into_iter()
59 LL | |         .filter(|(k, v)| (k % 2 == 0) && (v % 2 == 0))
60 LL | |         .collect();
61    | |__________________^ help: consider calling `.retain()` instead: `hash_map.retain(|k, &mut v| (k % 2 == 0) && (v % 2 == 0))`
62
63 error: this expression can be written more simply using `.retain()`
64   --> $DIR/manual_retain.rs:131:5
65    |
66 LL |     hash_set = hash_set.into_iter().filter(|x| x % 2 == 0).collect();
67    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
68
69 error: this expression can be written more simply using `.retain()`
70   --> $DIR/manual_retain.rs:132:5
71    |
72 LL |     hash_set = hash_set.iter().filter(|&x| x % 2 == 0).copied().collect();
73    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
74
75 error: this expression can be written more simply using `.retain()`
76   --> $DIR/manual_retain.rs:133:5
77    |
78 LL |     hash_set = hash_set.iter().filter(|&x| x % 2 == 0).cloned().collect();
79    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
80
81 error: this expression can be written more simply using `.retain()`
82   --> $DIR/manual_retain.rs:162:5
83    |
84 LL |     s = s.chars().filter(|&c| c != 'o').to_owned().collect();
85    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `s.retain(|c| c != 'o')`
86
87 error: this expression can be written more simply using `.retain()`
88   --> $DIR/manual_retain.rs:174:5
89    |
90 LL |     vec = vec.iter().filter(|&x| x % 2 == 0).copied().collect();
91    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
92
93 error: this expression can be written more simply using `.retain()`
94   --> $DIR/manual_retain.rs:175:5
95    |
96 LL |     vec = vec.iter().filter(|&x| x % 2 == 0).cloned().collect();
97    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
98
99 error: this expression can be written more simply using `.retain()`
100   --> $DIR/manual_retain.rs:176:5
101    |
102 LL |     vec = vec.into_iter().filter(|x| x % 2 == 0).collect();
103    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
104
105 error: this expression can be written more simply using `.retain()`
106   --> $DIR/manual_retain.rs:198:5
107    |
108 LL |     vec_deque = vec_deque.iter().filter(|&x| x % 2 == 0).copied().collect();
109    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
110
111 error: this expression can be written more simply using `.retain()`
112   --> $DIR/manual_retain.rs:199:5
113    |
114 LL |     vec_deque = vec_deque.iter().filter(|&x| x % 2 == 0).cloned().collect();
115    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
116
117 error: this expression can be written more simply using `.retain()`
118   --> $DIR/manual_retain.rs:200:5
119    |
120 LL |     vec_deque = vec_deque.into_iter().filter(|x| x % 2 == 0).collect();
121    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
122
123 error: aborting due to 19 previous errors
124