@@ -241,35 +241,23 @@ pub trait DoubleEndedSearcher<'a>: ReverseSearcher<'a> {}
241
241
#[ doc( hidden) ]
242
242
trait CharEq {
243
243
fn matches ( & mut self , c : char ) -> bool ;
244
- fn only_ascii ( & self ) -> bool ;
245
244
}
246
245
247
246
impl CharEq for char {
248
247
#[ inline]
249
248
fn matches ( & mut self , c : char ) -> bool { * self == c }
250
-
251
- #[ inline]
252
- fn only_ascii ( & self ) -> bool { ( * self as u32 ) < 128 }
253
249
}
254
250
255
251
impl < F > CharEq for F where F : FnMut ( char ) -> bool {
256
252
#[ inline]
257
253
fn matches ( & mut self , c : char ) -> bool { ( * self ) ( c) }
258
-
259
- #[ inline]
260
- fn only_ascii ( & self ) -> bool { false }
261
254
}
262
255
263
256
impl < ' a > CharEq for & ' a [ char ] {
264
257
#[ inline]
265
258
fn matches ( & mut self , c : char ) -> bool {
266
259
self . iter ( ) . any ( |& m| { let mut m = m; m. matches ( c) } )
267
260
}
268
-
269
- #[ inline]
270
- fn only_ascii ( & self ) -> bool {
271
- self . iter ( ) . all ( |m| m. only_ascii ( ) )
272
- }
273
261
}
274
262
275
263
struct CharEqPattern < C : CharEq > ( C ) ;
@@ -279,8 +267,6 @@ struct CharEqSearcher<'a, C: CharEq> {
279
267
char_eq : C ,
280
268
haystack : & ' a str ,
281
269
char_indices : super :: CharIndices < ' a > ,
282
- #[ allow( dead_code) ]
283
- ascii_only : bool ,
284
270
}
285
271
286
272
impl < ' a , C : CharEq > Pattern < ' a > for CharEqPattern < C > {
@@ -289,7 +275,6 @@ impl<'a, C: CharEq> Pattern<'a> for CharEqPattern<C> {
289
275
#[ inline]
290
276
fn into_searcher ( self , haystack : & ' a str ) -> CharEqSearcher < ' a , C > {
291
277
CharEqSearcher {
292
- ascii_only : self . 0 . only_ascii ( ) ,
293
278
haystack,
294
279
char_eq : self . 0 ,
295
280
char_indices : haystack. char_indices ( ) ,
@@ -499,7 +484,6 @@ impl<'a, F> fmt::Debug for CharPredicateSearcher<'a, F>
499
484
f. debug_struct ( "CharPredicateSearcher" )
500
485
. field ( "haystack" , & self . 0 . haystack )
501
486
. field ( "char_indices" , & self . 0 . char_indices )
502
- . field ( "ascii_only" , & self . 0 . ascii_only )
503
487
. finish ( )
504
488
}
505
489
}
0 commit comments