Skip to content

Commit de468c8

Browse files
committed
Added more missing lifetime annotations
1 parent c88a20d commit de468c8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/libcore/str.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2240,7 +2240,7 @@ pub mod traits {
22402240
#[cfg(test)]
22412241
pub mod traits {}
22422242
2243-
pub trait StrSlice {
2243+
pub trait StrSlice<'self> {
22442244
fn all(&self, it: &fn(char) -> bool) -> bool;
22452245
fn any(&self, it: &fn(char) -> bool) -> bool;
22462246
fn contains(&self, needle: &'a str) -> bool;
@@ -2260,9 +2260,9 @@ pub trait StrSlice {
22602260
fn len(&self) -> uint;
22612261
fn char_len(&self) -> uint;
22622262
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);
22662266
fn starts_with(&self, needle: &'a str) -> bool;
22672267
fn substr(&self, begin: uint, n: uint) -> &'self str;
22682268
fn to_lower(&self) -> ~str;
@@ -2283,7 +2283,7 @@ pub trait StrSlice {
22832283
}
22842284
22852285
/// Extension methods for strings
2286-
impl StrSlice for &'self str {
2286+
impl StrSlice<'self> for &'self str {
22872287
/**
22882288
* Return true if a predicate matches all characters or if the string
22892289
* contains no characters
@@ -2382,22 +2382,22 @@ impl StrSlice for &'self str {
23822382
}
23832383
/// Splits a string into substrings using a character function
23842384
#[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) {
23862386
each_split(*self, sepfn, it)
23872387
}
23882388
/**
23892389
* Splits a string into substrings at each occurrence of a given character
23902390
*/
23912391
#[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) {
23932393
each_split_char(*self, sep, it)
23942394
}
23952395
/**
23962396
* Splits a string into a vector of the substrings separated by a given
23972397
* string
23982398
*/
23992399
#[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) {
24012401
each_split_str(*self, sep, it)
24022402
}
24032403
/// Returns true if one string starts with another

0 commit comments

Comments
 (0)