@@ -133,69 +133,6 @@ fn filter_next() {
133133 let _ = foo. filter ( ) . next ( ) ;
134134}
135135
136- /// Checks implementation of `SEARCH_IS_SOME` lint.
137- #[ rustfmt:: skip]
138- fn search_is_some ( ) {
139- let v = vec ! [ 3 , 2 , 1 , 0 , -1 , -2 , -3 ] ;
140- let y = & & 42 ;
141-
142- // Check `find().is_some()`, single-line case.
143- let _ = v. iter ( ) . find ( |& x| * x < 0 ) . is_some ( ) ;
144- let _ = ( 0 ..1 ) . find ( |x| * * y == * x) . is_some ( ) ; // one dereference less
145- let _ = ( 0 ..1 ) . find ( |x| * x == 0 ) . is_some ( ) ;
146- let _ = v. iter ( ) . find ( |x| * * x == 0 ) . is_some ( ) ;
147-
148- // Check `find().is_some()`, multi-line case.
149- let _ = v. iter ( ) . find ( |& x| {
150- * x < 0
151- }
152- ) . is_some ( ) ;
153-
154- // Check `position().is_some()`, single-line case.
155- let _ = v. iter ( ) . position ( |& x| x < 0 ) . is_some ( ) ;
156-
157- // Check `position().is_some()`, multi-line case.
158- let _ = v. iter ( ) . position ( |& x| {
159- x < 0
160- }
161- ) . is_some ( ) ;
162-
163- // Check `rposition().is_some()`, single-line case.
164- let _ = v. iter ( ) . rposition ( |& x| x < 0 ) . is_some ( ) ;
165-
166- // Check `rposition().is_some()`, multi-line case.
167- let _ = v. iter ( ) . rposition ( |& x| {
168- x < 0
169- }
170- ) . is_some ( ) ;
171-
172- let s1 = String :: from ( "hello world" ) ;
173- let s2 = String :: from ( "world" ) ;
174- // Check caller `find()` is a &`static str case
175- let _ = "hello world" . find ( "world" ) . is_some ( ) ;
176- let _ = "hello world" . find ( & s2) . is_some ( ) ;
177- let _ = "hello world" . find ( & s2[ 2 ..] ) . is_some ( ) ;
178- // Check caller of `find()` is a String case
179- let _ = s1. find ( "world" ) . is_some ( ) ;
180- let _ = s1. find ( & s2) . is_some ( ) ;
181- let _ = s1. find ( & s2[ 2 ..] ) . is_some ( ) ;
182- // Check caller of `find()` is a slice of String case
183- let _ = s1[ 2 ..] . find ( "world" ) . is_some ( ) ;
184- let _ = s1[ 2 ..] . find ( & s2) . is_some ( ) ;
185- let _ = s1[ 2 ..] . find ( & s2[ 2 ..] ) . is_some ( ) ;
186-
187- // Check that we don't lint if `find()` is called with
188- // Pattern that is not a string
189- let _ = s1. find ( |c : char | c == 'o' || c == 'l' ) . is_some ( ) ;
190-
191- // Check that we don't lint if the caller is not an `Iterator` or string
192- let foo = IteratorFalsePositives { foo : 0 } ;
193- let _ = foo. find ( ) . is_some ( ) ;
194- let _ = foo. position ( ) . is_some ( ) ;
195- let _ = foo. rposition ( ) . is_some ( ) ;
196- }
197-
198136fn main ( ) {
199137 filter_next ( ) ;
200- search_is_some ( ) ;
201138}
0 commit comments