@@ -241,35 +241,23 @@ pub trait DoubleEndedSearcher<'a>: ReverseSearcher<'a> {}
241241#[ doc( hidden) ]
242242trait CharEq {
243243 fn matches ( & mut self , c : char ) -> bool ;
244- fn only_ascii ( & self ) -> bool ;
245244}
246245
247246impl CharEq for char {
248247 #[ inline]
249248 fn matches ( & mut self , c : char ) -> bool { * self == c }
250-
251- #[ inline]
252- fn only_ascii ( & self ) -> bool { ( * self as u32 ) < 128 }
253249}
254250
255251impl < F > CharEq for F where F : FnMut ( char ) -> bool {
256252 #[ inline]
257253 fn matches ( & mut self , c : char ) -> bool { ( * self ) ( c) }
258-
259- #[ inline]
260- fn only_ascii ( & self ) -> bool { false }
261254}
262255
263256impl < ' a > CharEq for & ' a [ char ] {
264257 #[ inline]
265258 fn matches ( & mut self , c : char ) -> bool {
266259 self . iter ( ) . any ( |& m| { let mut m = m; m. matches ( c) } )
267260 }
268-
269- #[ inline]
270- fn only_ascii ( & self ) -> bool {
271- self . iter ( ) . all ( |m| m. only_ascii ( ) )
272- }
273261}
274262
275263struct CharEqPattern < C : CharEq > ( C ) ;
@@ -279,8 +267,6 @@ struct CharEqSearcher<'a, C: CharEq> {
279267 char_eq : C ,
280268 haystack : & ' a str ,
281269 char_indices : super :: CharIndices < ' a > ,
282- #[ allow( dead_code) ]
283- ascii_only : bool ,
284270}
285271
286272impl < ' a , C : CharEq > Pattern < ' a > for CharEqPattern < C > {
@@ -289,7 +275,6 @@ impl<'a, C: CharEq> Pattern<'a> for CharEqPattern<C> {
289275 #[ inline]
290276 fn into_searcher ( self , haystack : & ' a str ) -> CharEqSearcher < ' a , C > {
291277 CharEqSearcher {
292- ascii_only : self . 0 . only_ascii ( ) ,
293278 haystack,
294279 char_eq : self . 0 ,
295280 char_indices : haystack. char_indices ( ) ,
@@ -499,7 +484,6 @@ impl<'a, F> fmt::Debug for CharPredicateSearcher<'a, F>
499484 f. debug_struct ( "CharPredicateSearcher" )
500485 . field ( "haystack" , & self . 0 . haystack )
501486 . field ( "char_indices" , & self . 0 . char_indices )
502- . field ( "ascii_only" , & self . 0 . ascii_only )
503487 . finish ( )
504488 }
505489}
0 commit comments