@@ -1497,10 +1497,7 @@ impl String {
1497
1497
/// ```
1498
1498
#[ cfg( not( no_global_oom_handling) ) ]
1499
1499
#[ unstable( feature = "string_remove_matches" , reason = "new API" , issue = "72826" ) ]
1500
- pub fn remove_matches < ' a , P > ( & ' a mut self , pat : P )
1501
- where
1502
- P : for < ' x > Pattern < ' x > ,
1503
- {
1500
+ pub fn remove_matches < P : Pattern > ( & mut self , pat : P ) {
1504
1501
use core:: str:: pattern:: Searcher ;
1505
1502
1506
1503
let rejections = {
@@ -2288,35 +2285,41 @@ impl<'a> Extend<Cow<'a, str>> for String {
2288
2285
reason = "API not fully fleshed out and ready to be stabilized" ,
2289
2286
issue = "27721"
2290
2287
) ]
2291
- impl < ' a , ' b > Pattern < ' a > for & ' b String {
2292
- type Searcher = <& ' b str as Pattern < ' a > > :: Searcher ;
2288
+ impl < ' b > Pattern for & ' b String {
2289
+ type Searcher < ' a > = <& ' b str as Pattern > :: Searcher < ' a > ;
2293
2290
2294
- fn into_searcher ( self , haystack : & ' a str ) -> <& ' b str as Pattern < ' a > > :: Searcher {
2291
+ fn into_searcher ( self , haystack : & str ) -> <& ' b str as Pattern > :: Searcher < ' _ > {
2295
2292
self [ ..] . into_searcher ( haystack)
2296
2293
}
2297
2294
2298
2295
#[ inline]
2299
- fn is_contained_in ( self , haystack : & ' a str ) -> bool {
2296
+ fn is_contained_in ( self , haystack : & str ) -> bool {
2300
2297
self [ ..] . is_contained_in ( haystack)
2301
2298
}
2302
2299
2303
2300
#[ inline]
2304
- fn is_prefix_of ( self , haystack : & ' a str ) -> bool {
2301
+ fn is_prefix_of ( self , haystack : & str ) -> bool {
2305
2302
self [ ..] . is_prefix_of ( haystack)
2306
2303
}
2307
2304
2308
2305
#[ inline]
2309
- fn strip_prefix_of ( self , haystack : & ' a str ) -> Option < & ' a str > {
2306
+ fn strip_prefix_of ( self , haystack : & str ) -> Option < & str > {
2310
2307
self [ ..] . strip_prefix_of ( haystack)
2311
2308
}
2312
2309
2313
2310
#[ inline]
2314
- fn is_suffix_of ( self , haystack : & ' a str ) -> bool {
2311
+ fn is_suffix_of < ' a > ( self , haystack : & ' a str ) -> bool
2312
+ where
2313
+ Self :: Searcher < ' a > : core:: str:: pattern:: ReverseSearcher < ' a > ,
2314
+ {
2315
2315
self [ ..] . is_suffix_of ( haystack)
2316
2316
}
2317
2317
2318
2318
#[ inline]
2319
- fn strip_suffix_of ( self , haystack : & ' a str ) -> Option < & ' a str > {
2319
+ fn strip_suffix_of < ' a > ( self , haystack : & ' a str ) -> Option < & str >
2320
+ where
2321
+ Self :: Searcher < ' a > : core:: str:: pattern:: ReverseSearcher < ' a > ,
2322
+ {
2320
2323
self [ ..] . strip_suffix_of ( haystack)
2321
2324
}
2322
2325
}
0 commit comments