@@ -177,34 +177,6 @@ impl<'a> Input<'a> for StringInput<'a> {
177
177
ret
178
178
}
179
179
180
- fn find < F > ( & mut self , mut pred : F ) -> Option < BytePos >
181
- where
182
- F : FnMut ( char ) -> bool ,
183
- {
184
- let last = {
185
- let mut last = 0 ;
186
- for c in self . iter . clone ( ) {
187
- last += c. len_utf8 ( ) ;
188
- if pred ( c) {
189
- break ;
190
- }
191
- }
192
- last
193
- } ;
194
-
195
- if last == 0 {
196
- return None ;
197
- }
198
-
199
- let s = self . iter . as_str ( ) ;
200
- debug_assert ! ( last <= s. len( ) ) ;
201
-
202
- self . last_pos = self . last_pos + BytePos ( last as _ ) ;
203
- self . iter = unsafe { s. get_unchecked ( last..) } . chars ( ) ;
204
-
205
- Some ( self . last_pos )
206
- }
207
-
208
180
#[ inline]
209
181
unsafe fn reset_to ( & mut self , to : BytePos ) {
210
182
let orig = self . orig ;
@@ -284,11 +256,6 @@ pub trait Input<'a>: Clone {
284
256
where
285
257
F : FnMut ( char ) -> bool ;
286
258
287
- /// This method modifies [last_pos()] and [cur_pos()].
288
- fn find < F > ( & mut self , f : F ) -> Option < BytePos >
289
- where
290
- F : FnMut ( char ) -> bool ;
291
-
292
259
/// # Safety
293
260
///
294
261
/// - `to` be in the valid range of input.
@@ -397,17 +364,17 @@ mod tests {
397
364
} ) ;
398
365
}
399
366
400
- #[ test]
401
- fn src_input_find_01 ( ) {
402
- with_test_sess ( "foo/d" , |mut i| {
403
- assert_eq ! ( i. cur_pos( ) , BytePos ( 1 ) ) ;
404
- assert_eq ! ( i. last_pos, BytePos ( 1 ) ) ;
405
-
406
- assert_eq ! ( i. find( |c| c == '/' ) , Some ( BytePos ( 5 ) ) ) ;
407
- assert_eq ! ( i. last_pos, BytePos ( 5 ) ) ;
408
- assert_eq ! ( i. cur( ) , Some ( 'd' ) ) ;
409
- } ) ;
410
- }
367
+ // #[test]
368
+ // fn src_input_find_01() {
369
+ // with_test_sess("foo/d", |mut i| {
370
+ // assert_eq!(i.cur_pos(), BytePos(1));
371
+ // assert_eq!(i.last_pos, BytePos(1));
372
+
373
+ // assert_eq!(i.find(|c| c == '/'), Some(BytePos(5)));
374
+ // assert_eq!(i.last_pos, BytePos(5));
375
+ // assert_eq!(i.cur(), Some('d'));
376
+ // });
377
+ // }
411
378
412
379
// #[test]
413
380
// fn src_input_smoke_02() {
0 commit comments