More purity to make it easier to borrow strings in format strings.
This commit is contained in:
parent
f5be06fa1f
commit
7ecddb2771
3 changed files with 9 additions and 9 deletions
|
@ -1934,7 +1934,7 @@ trait str_slice {
|
|||
fn is_whitespace() -> bool;
|
||||
fn is_alphanumeric() -> bool;
|
||||
pure fn len() -> uint;
|
||||
fn slice(begin: uint, end: uint) -> ~str;
|
||||
pure fn slice(begin: uint, end: uint) -> ~str;
|
||||
fn split(sepfn: fn(char) -> bool) -> ~[~str];
|
||||
fn split_char(sep: char) -> ~[~str];
|
||||
fn split_str(sep: &a/str) -> ~[~str];
|
||||
|
@ -1944,7 +1944,7 @@ trait str_slice {
|
|||
fn to_upper() -> ~str;
|
||||
fn escape_default() -> ~str;
|
||||
fn escape_unicode() -> ~str;
|
||||
fn to_unique() -> ~str;
|
||||
pure fn to_unique() -> ~str;
|
||||
}
|
||||
|
||||
/// Extension methods for strings
|
||||
|
@ -2013,7 +2013,7 @@ impl extensions/& of str_slice for &str {
|
|||
* beyond the last character of the string
|
||||
*/
|
||||
#[inline]
|
||||
fn slice(begin: uint, end: uint) -> ~str { slice(self, begin, end) }
|
||||
pure fn slice(begin: uint, end: uint) -> ~str { slice(self, begin, end) }
|
||||
/// Splits a string into substrings using a character function
|
||||
#[inline]
|
||||
fn split(sepfn: fn(char) -> bool) -> ~[~str] { split(self, sepfn) }
|
||||
|
@ -2053,7 +2053,7 @@ impl extensions/& of str_slice for &str {
|
|||
fn escape_unicode() -> ~str { escape_unicode(self) }
|
||||
|
||||
#[inline]
|
||||
fn to_unique() -> ~str { self.slice(0, self.len()) }
|
||||
pure fn to_unique() -> ~str { self.slice(0, self.len()) }
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue