@@ -2240,7 +2240,7 @@ pub mod traits {
2240
2240
#[cfg(test)]
2241
2241
pub mod traits {}
2242
2242
2243
- pub trait StrSlice {
2243
+ pub trait StrSlice<'self> {
2244
2244
fn all(&self, it: &fn(char) -> bool) -> bool;
2245
2245
fn any(&self, it: &fn(char) -> bool) -> bool;
2246
2246
fn contains(&self, needle: &'a str) -> bool;
@@ -2260,9 +2260,9 @@ pub trait StrSlice {
2260
2260
fn len(&self) -> uint;
2261
2261
fn char_len(&self) -> uint;
2262
2262
fn slice(&self, begin: uint, end: uint) -> &'self str;
2263
- fn each_split(&self, sepfn: &fn(char) -> bool, it: &fn(&str) -> bool);
2264
- fn each_split_char(&self, sep: char, it: &fn(&str) -> bool);
2265
- fn each_split_str(&self, sep: &'a str, it: &fn(&str) -> bool);
2263
+ fn each_split(&self, sepfn: &fn(char) -> bool, it: &fn(&'self str) -> bool);
2264
+ fn each_split_char(&self, sep: char, it: &fn(&'self str) -> bool);
2265
+ fn each_split_str(&self, sep: &'a str, it: &fn(&'self str) -> bool);
2266
2266
fn starts_with(&self, needle: &'a str) -> bool;
2267
2267
fn substr(&self, begin: uint, n: uint) -> &'self str;
2268
2268
fn to_lower(&self) -> ~str;
@@ -2283,7 +2283,7 @@ pub trait StrSlice {
2283
2283
}
2284
2284
2285
2285
/// Extension methods for strings
2286
- impl StrSlice for &'self str {
2286
+ impl StrSlice<'self> for &'self str {
2287
2287
/**
2288
2288
* Return true if a predicate matches all characters or if the string
2289
2289
* contains no characters
@@ -2382,22 +2382,22 @@ impl StrSlice for &'self str {
2382
2382
}
2383
2383
/// Splits a string into substrings using a character function
2384
2384
#[inline]
2385
- fn each_split(&self, sepfn: &fn(char) -> bool, it: &fn(&str) -> bool) {
2385
+ fn each_split(&self, sepfn: &fn(char) -> bool, it: &fn(&'self str) -> bool) {
2386
2386
each_split(*self, sepfn, it)
2387
2387
}
2388
2388
/**
2389
2389
* Splits a string into substrings at each occurrence of a given character
2390
2390
*/
2391
2391
#[inline]
2392
- fn each_split_char(&self, sep: char, it: &fn(&str) -> bool) {
2392
+ fn each_split_char(&self, sep: char, it: &fn(&'self str) -> bool) {
2393
2393
each_split_char(*self, sep, it)
2394
2394
}
2395
2395
/**
2396
2396
* Splits a string into a vector of the substrings separated by a given
2397
2397
* string
2398
2398
*/
2399
2399
#[inline]
2400
- fn each_split_str(&self, sep: &'a str, it: &fn(&str) -> bool) {
2400
+ fn each_split_str(&self, sep: &'a str, it: &fn(&'self str) -> bool) {
2401
2401
each_split_str(*self, sep, it)
2402
2402
}
2403
2403
/// Returns true if one string starts with another
0 commit comments