]> git.lizzy.rs Git - rust.git/blob - tests/ui/search_is_some.stderr
Use `ExprUseVisitor` and multipart suggestion to avoid iffy `String` replacement
[rust.git] / tests / ui / search_is_some.stderr
1 error: called `is_some()` after searching an `Iterator` with `find`
2   --> $DIR/search_is_some.rs:14:13
3    |
4 LL |       let _ = v.iter().find(|&x| {
5    |  _____________^
6 LL | |                               *x < 0
7 LL | |                           }
8 LL | |                    ).is_some();
9    | |______________________________^
10    |
11    = note: `-D clippy::search-is-some` implied by `-D warnings`
12    = help: this is more succinctly expressed by calling `any()`
13
14 error: called `is_some()` after searching an `Iterator` with `position`
15   --> $DIR/search_is_some.rs:20:13
16    |
17 LL |       let _ = v.iter().position(|&x| {
18    |  _____________^
19 LL | |                                   x < 0
20 LL | |                               }
21 LL | |                    ).is_some();
22    | |______________________________^
23    |
24    = help: this is more succinctly expressed by calling `any()`
25
26 error: called `is_some()` after searching an `Iterator` with `rposition`
27   --> $DIR/search_is_some.rs:26:13
28    |
29 LL |       let _ = v.iter().rposition(|&x| {
30    |  _____________^
31 LL | |                                    x < 0
32 LL | |                                }
33 LL | |                    ).is_some();
34    | |______________________________^
35    |
36    = help: this is more succinctly expressed by calling `any()`
37
38 error: called `is_some()` after searching an `Iterator` with `find`
39   --> $DIR/search_is_some.rs:41:20
40    |
41 LL |     let _ = (0..1).find(|x| **y == *x).is_some(); // one dereference less
42    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43    |
44 help: use `any()` instead
45    |
46 LL |     let _ = (0..1).any(|x| **y == *x); // one dereference less
47    |                    ^^^^^^^^^^^^^^^^^^
48 help: ...and remove deref
49    |
50 LL |     let _ = (0..1).find(|x| **y == x).is_some(); // one dereference less
51    |                                    ^
52
53 error: called `is_some()` after searching an `Iterator` with `find`
54   --> $DIR/search_is_some.rs:42:20
55    |
56 LL |     let _ = (0..1).find(|x| *x == 0).is_some();
57    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
58    |
59 help: use `any()` instead
60    |
61 LL |     let _ = (0..1).any(|x| *x == 0);
62    |                    ^^^^^^^^^^^^^^^^
63 help: ...and remove deref
64    |
65 LL |     let _ = (0..1).find(|x| x == 0).is_some();
66    |                             ^
67
68 error: called `is_some()` after searching an `Iterator` with `find`
69   --> $DIR/search_is_some.rs:43:22
70    |
71 LL |     let _ = v.iter().find(|x| **x == 0).is_some();
72    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
73    |
74 help: use `any()` instead
75    |
76 LL |     let _ = v.iter().any(|x| **x == 0);
77    |                      ^^^^^^^^^^^^^^^^^
78 help: ...and remove deref
79    |
80 LL |     let _ = v.iter().find(|x| *x == 0).is_some();
81    |                               ^^
82
83 error: called `is_none()` after searching an `Iterator` with `find`
84   --> $DIR/search_is_some.rs:53:13
85    |
86 LL |       let _ = v.iter().find(|&x| {
87    |  _____________^
88 LL | |                               *x < 0
89 LL | |                           }
90 LL | |                    ).is_none();
91    | |______________________________^
92    |
93    = help: this is more succinctly expressed by calling `any()` with negation
94
95 error: called `is_none()` after searching an `Iterator` with `position`
96   --> $DIR/search_is_some.rs:59:13
97    |
98 LL |       let _ = v.iter().position(|&x| {
99    |  _____________^
100 LL | |                                   x < 0
101 LL | |                               }
102 LL | |                    ).is_none();
103    | |______________________________^
104    |
105    = help: this is more succinctly expressed by calling `any()` with negation
106
107 error: called `is_none()` after searching an `Iterator` with `rposition`
108   --> $DIR/search_is_some.rs:65:13
109    |
110 LL |       let _ = v.iter().rposition(|&x| {
111    |  _____________^
112 LL | |                                    x < 0
113 LL | |                                }
114 LL | |                    ).is_none();
115    | |______________________________^
116    |
117    = help: this is more succinctly expressed by calling `any()` with negation
118
119 error: called `is_none()` after searching an `Iterator` with `find`
120   --> $DIR/search_is_some.rs:80:13
121    |
122 LL |     let _ = (0..1).find(|x| **y == *x).is_none(); // one dereference less
123    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
124    |
125 help: use `!_.any()` instead
126    |
127 LL |     let _ = !(0..1).any(|x| **y == *x); // one dereference less
128    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
129 help: ...and remove deref
130    |
131 LL |     let _ = (0..1).find(|x| **y == x).is_none(); // one dereference less
132    |                                    ^
133
134 error: called `is_none()` after searching an `Iterator` with `find`
135   --> $DIR/search_is_some.rs:81:13
136    |
137 LL |     let _ = (0..1).find(|x| *x == 0).is_none();
138    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
139    |
140 help: use `!_.any()` instead
141    |
142 LL |     let _ = !(0..1).any(|x| *x == 0);
143    |             ^^^^^^^^^^^^^^^^^^^^^^^^
144 help: ...and remove deref
145    |
146 LL |     let _ = (0..1).find(|x| x == 0).is_none();
147    |                             ^
148
149 error: called `is_none()` after searching an `Iterator` with `find`
150   --> $DIR/search_is_some.rs:82:13
151    |
152 LL |     let _ = v.iter().find(|x| **x == 0).is_none();
153    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
154    |
155 help: use `!_.any()` instead
156    |
157 LL |     let _ = !v.iter().any(|x| **x == 0);
158    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
159 help: ...and remove deref
160    |
161 LL |     let _ = v.iter().find(|x| *x == 0).is_none();
162    |                               ^^
163
164 error: called `is_none()` after searching an `Iterator` with `find`
165   --> $DIR/search_is_some.rs:98:25
166    |
167 LL |             .filter(|c| filter_hand.iter().find(|cc| c == cc).is_none())
168    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
169    |
170 help: use `!_.any()` instead
171    |
172 LL |             .filter(|c| !filter_hand.iter().any(|cc| c == cc))
173    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
174 help: ...and borrow variable
175    |
176 LL |             .filter(|c| filter_hand.iter().find(|cc| c == &cc).is_none())
177    |                                                           ^^^
178
179 error: called `is_none()` after searching an `Iterator` with `find`
180   --> $DIR/search_is_some.rs:114:30
181    |
182 LL |             .filter(|(c, _)| filter_hand.iter().find(|cc| c == *cc).is_none())
183    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
184    |
185 help: use `!_.any()` instead
186    |
187 LL |             .filter(|(c, _)| !filter_hand.iter().any(|cc| c == *cc))
188    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
189 help: ...and remove deref
190    |
191 LL |             .filter(|(c, _)| filter_hand.iter().find(|cc| c == cc).is_none())
192    |                                                                ^^
193
194 error: aborting due to 14 previous errors
195