@@ -1361,7 +1361,7 @@ pub pure fn is_whitespace(s: &str) -> bool {
1361
1361
*
1362
1362
* Alphanumeric characters are determined by `char::is_alphanumeric`
1363
1363
*/
1364
- pure fn is_alphanumeric ( s : & str ) -> bool {
1364
+ fn is_alphanumeric ( s : & str ) -> bool {
1365
1365
return all ( s, char:: is_alphanumeric) ;
1366
1366
}
1367
1367
@@ -2030,22 +2030,22 @@ pub mod raw {
2030
2030
}
2031
2031
2032
2032
pub trait UniqueStr {
2033
- pure fn trim ( ) -> self ;
2034
- pure fn trim_left ( ) -> self ;
2035
- pure fn trim_right ( ) -> self ;
2033
+ fn trim ( ) -> self ;
2034
+ fn trim_left ( ) -> self ;
2035
+ fn trim_right ( ) -> self ;
2036
2036
}
2037
2037
2038
2038
/// Extension methods for strings
2039
2039
impl ~str : UniqueStr {
2040
2040
/// Returns a string with leading and trailing whitespace removed
2041
2041
#[ inline]
2042
- pure fn trim ( ) -> ~str { trim ( self ) }
2042
+ fn trim ( ) -> ~str { trim ( self ) }
2043
2043
/// Returns a string with leading whitespace removed
2044
2044
#[ inline]
2045
- pure fn trim_left ( ) -> ~str { trim_left ( self ) }
2045
+ fn trim_left ( ) -> ~str { trim_left ( self ) }
2046
2046
/// Returns a string with trailing whitespace removed
2047
2047
#[ inline]
2048
- pure fn trim_right ( ) -> ~str { trim_right ( self ) }
2048
+ fn trim_right ( ) -> ~str { trim_right ( self ) }
2049
2049
}
2050
2050
2051
2051
#[ cfg( notest) ]
@@ -2062,33 +2062,33 @@ pub mod traits {
2062
2062
pub mod traits { }
2063
2063
2064
2064
pub trait StrSlice {
2065
- pure fn all ( it : fn ( char ) -> bool ) -> bool ;
2066
- pure fn any ( it : fn ( char ) -> bool ) -> bool ;
2067
- pure fn contains ( needle : & a/str ) -> bool ;
2068
- pure fn contains_char ( needle : char ) -> bool ;
2069
- pure fn each ( it : fn ( u8 ) -> bool ) ;
2070
- pure fn eachi ( it : fn ( uint , u8 ) -> bool ) ;
2071
- pure fn each_char ( it : fn ( char ) -> bool ) ;
2072
- pure fn each_chari ( it : fn ( uint , char ) -> bool ) ;
2073
- pure fn ends_with ( needle : & str ) -> bool ;
2074
- pure fn is_empty ( ) -> bool ;
2075
- pure fn is_not_empty ( ) -> bool ;
2076
- pure fn is_whitespace ( ) -> bool ;
2077
- pure fn is_alphanumeric ( ) -> bool ;
2065
+ fn all ( it : fn ( char ) -> bool ) -> bool ;
2066
+ fn any ( it : fn ( char ) -> bool ) -> bool ;
2067
+ fn contains ( needle : & a/str ) -> bool ;
2068
+ fn contains_char ( needle : char ) -> bool ;
2069
+ fn each ( it : fn ( u8 ) -> bool ) ;
2070
+ fn eachi ( it : fn ( uint , u8 ) -> bool ) ;
2071
+ fn each_char ( it : fn ( char ) -> bool ) ;
2072
+ fn each_chari ( it : fn ( uint , char ) -> bool ) ;
2073
+ fn ends_with ( needle : & str ) -> bool ;
2074
+ fn is_empty ( ) -> bool ;
2075
+ fn is_not_empty ( ) -> bool ;
2076
+ fn is_whitespace ( ) -> bool ;
2077
+ fn is_alphanumeric ( ) -> bool ;
2078
2078
pure fn len ( ) -> uint ;
2079
2079
pure fn slice ( begin : uint , end : uint ) -> ~str ;
2080
- pure fn split ( sepfn : fn ( char ) -> bool ) -> ~[ ~str ] ;
2081
- pure fn split_char ( sep : char ) -> ~[ ~str ] ;
2082
- pure fn split_str ( sep : & a/str ) -> ~[ ~str ] ;
2083
- pure fn starts_with ( needle : & a/str ) -> bool ;
2084
- pure fn substr ( begin : uint , n : uint ) -> ~str ;
2080
+ fn split ( sepfn : fn ( char ) -> bool ) -> ~[ ~str ] ;
2081
+ fn split_char ( sep : char ) -> ~[ ~str ] ;
2082
+ fn split_str ( sep : & a/str ) -> ~[ ~str ] ;
2083
+ fn starts_with ( needle : & a/str ) -> bool ;
2084
+ fn substr ( begin : uint , n : uint ) -> ~str ;
2085
2085
pure fn to_lower ( ) -> ~str ;
2086
2086
pure fn to_upper ( ) -> ~str ;
2087
- pure fn escape_default ( ) -> ~str ;
2088
- pure fn escape_unicode ( ) -> ~str ;
2089
- pure fn trim ( ) -> ~str ;
2090
- pure fn trim_left ( ) -> ~str ;
2091
- pure fn trim_right ( ) -> ~str ;
2087
+ fn escape_default ( ) -> ~str ;
2088
+ fn escape_unicode ( ) -> ~str ;
2089
+ fn trim ( ) -> ~str ;
2090
+ fn trim_left ( ) -> ~str ;
2091
+ fn trim_right ( ) -> ~str ;
2092
2092
pure fn to_unique ( ) -> ~str ;
2093
2093
pure fn char_at ( i : uint ) -> char ;
2094
2094
}
@@ -2100,56 +2100,54 @@ impl &str: StrSlice {
2100
2100
* contains no characters
2101
2101
*/
2102
2102
#[ inline]
2103
- pure fn all ( it : fn ( char ) -> bool ) -> bool { all ( self , it) }
2103
+ fn all ( it : fn ( char ) -> bool ) -> bool { all ( self , it) }
2104
2104
/**
2105
2105
* Return true if a predicate matches any character (and false if it
2106
2106
* matches none or there are no characters)
2107
2107
*/
2108
2108
#[ inline]
2109
- pure fn any ( it : fn ( char ) -> bool ) -> bool { any ( self , it) }
2109
+ fn any ( it : fn ( char ) -> bool ) -> bool { any ( self , it) }
2110
2110
/// Returns true if one string contains another
2111
2111
#[ inline]
2112
- pure fn contains ( needle : & a/str ) -> bool { contains ( self , needle) }
2112
+ fn contains ( needle : & a/str ) -> bool { contains ( self , needle) }
2113
2113
/// Returns true if a string contains a char
2114
2114
#[ inline]
2115
- pure fn contains_char ( needle : char ) -> bool {
2116
- contains_char ( self , needle)
2117
- }
2115
+ fn contains_char ( needle : char ) -> bool { contains_char ( self , needle) }
2118
2116
/// Iterate over the bytes in a string
2119
2117
#[ inline]
2120
- pure fn each ( it : fn ( u8 ) -> bool ) { each ( self , it) }
2118
+ fn each ( it : fn ( u8 ) -> bool ) { each ( self , it) }
2121
2119
/// Iterate over the bytes in a string, with indices
2122
2120
#[ inline]
2123
- pure fn eachi ( it : fn ( uint , u8 ) -> bool ) { eachi ( self , it) }
2121
+ fn eachi ( it : fn ( uint , u8 ) -> bool ) { eachi ( self , it) }
2124
2122
/// Iterate over the chars in a string
2125
2123
#[ inline]
2126
- pure fn each_char ( it : fn ( char ) -> bool ) { each_char ( self , it) }
2124
+ fn each_char ( it : fn ( char ) -> bool ) { each_char ( self , it) }
2127
2125
/// Iterate over the chars in a string, with indices
2128
2126
#[ inline]
2129
- pure fn each_chari ( it : fn ( uint , char ) -> bool ) { each_chari ( self , it) }
2127
+ fn each_chari ( it : fn ( uint , char ) -> bool ) { each_chari ( self , it) }
2130
2128
/// Returns true if one string ends with another
2131
2129
#[ inline]
2132
- pure fn ends_with ( needle : & str ) -> bool { ends_with ( self , needle) }
2130
+ fn ends_with ( needle : & str ) -> bool { ends_with ( self , needle) }
2133
2131
/// Returns true if the string has length 0
2134
2132
#[ inline]
2135
- pure fn is_empty ( ) -> bool { is_empty ( self ) }
2133
+ fn is_empty ( ) -> bool { is_empty ( self ) }
2136
2134
/// Returns true if the string has length greater than 0
2137
2135
#[ inline]
2138
- pure fn is_not_empty ( ) -> bool { is_not_empty ( self ) }
2136
+ fn is_not_empty ( ) -> bool { is_not_empty ( self ) }
2139
2137
/**
2140
2138
* Returns true if the string contains only whitespace
2141
2139
*
2142
2140
* Whitespace characters are determined by `char::is_whitespace`
2143
2141
*/
2144
2142
#[ inline]
2145
- pure fn is_whitespace ( ) -> bool { is_whitespace ( self ) }
2143
+ fn is_whitespace ( ) -> bool { is_whitespace ( self ) }
2146
2144
/**
2147
2145
* Returns true if the string contains only alphanumerics
2148
2146
*
2149
2147
* Alphanumeric characters are determined by `char::is_alphanumeric`
2150
2148
*/
2151
2149
#[ inline]
2152
- pure fn is_alphanumeric ( ) -> bool { is_alphanumeric ( self ) }
2150
+ fn is_alphanumeric ( ) -> bool { is_alphanumeric ( self ) }
2153
2151
#[ inline]
2154
2152
/// Returns the size in bytes not counting the null terminator
2155
2153
pure fn len ( ) -> uint { len ( self ) }
@@ -2164,29 +2162,29 @@ impl &str: StrSlice {
2164
2162
pure fn slice ( begin : uint , end : uint ) -> ~str { slice ( self , begin, end) }
2165
2163
/// Splits a string into substrings using a character function
2166
2164
#[ inline]
2167
- pure fn split ( sepfn : fn ( char ) -> bool ) -> ~[ ~str ] { split ( self , sepfn) }
2165
+ fn split ( sepfn : fn ( char ) -> bool ) -> ~[ ~str ] { split ( self , sepfn) }
2168
2166
/**
2169
2167
* Splits a string into substrings at each occurrence of a given character
2170
2168
*/
2171
2169
#[ inline]
2172
- pure fn split_char ( sep : char ) -> ~[ ~str ] { split_char ( self , sep) }
2170
+ fn split_char ( sep : char ) -> ~[ ~str ] { split_char ( self , sep) }
2173
2171
/**
2174
2172
* Splits a string into a vector of the substrings separated by a given
2175
2173
* string
2176
2174
*/
2177
2175
#[ inline]
2178
- pure fn split_str ( sep : & a/str ) -> ~[ ~str ] { split_str ( self , sep) }
2176
+ fn split_str ( sep : & a/str ) -> ~[ ~str ] { split_str ( self , sep) }
2179
2177
/// Returns true if one string starts with another
2180
2178
#[ inline]
2181
- pure fn starts_with ( needle : & a/str ) -> bool { starts_with ( self , needle) }
2179
+ fn starts_with ( needle : & a/str ) -> bool { starts_with ( self , needle) }
2182
2180
/**
2183
2181
* Take a substring of another.
2184
2182
*
2185
2183
* Returns a string containing `n` characters starting at byte offset
2186
2184
* `begin`.
2187
2185
*/
2188
2186
#[ inline]
2189
- pure fn substr ( begin : uint , n : uint ) -> ~str { substr ( self , begin, n) }
2187
+ fn substr ( begin : uint , n : uint ) -> ~str { substr ( self , begin, n) }
2190
2188
/// Convert a string to lowercase
2191
2189
#[ inline]
2192
2190
pure fn to_lower ( ) -> ~str { to_lower ( self ) }
@@ -2195,20 +2193,20 @@ impl &str: StrSlice {
2195
2193
pure fn to_upper ( ) -> ~str { to_upper ( self ) }
2196
2194
/// Escape each char in `s` with char::escape_default.
2197
2195
#[ inline]
2198
- pure fn escape_default ( ) -> ~str { escape_default ( self ) }
2196
+ fn escape_default ( ) -> ~str { escape_default ( self ) }
2199
2197
/// Escape each char in `s` with char::escape_unicode.
2200
2198
#[ inline]
2201
- pure fn escape_unicode ( ) -> ~str { escape_unicode ( self ) }
2199
+ fn escape_unicode ( ) -> ~str { escape_unicode ( self ) }
2202
2200
2203
2201
/// Returns a string with leading and trailing whitespace removed
2204
2202
#[ inline]
2205
- pure fn trim ( ) -> ~str { trim ( self ) }
2203
+ fn trim ( ) -> ~str { trim ( self ) }
2206
2204
/// Returns a string with leading whitespace removed
2207
2205
#[ inline]
2208
- pure fn trim_left ( ) -> ~str { trim_left ( self ) }
2206
+ fn trim_left ( ) -> ~str { trim_left ( self ) }
2209
2207
/// Returns a string with trailing whitespace removed
2210
2208
#[ inline]
2211
- pure fn trim_right ( ) -> ~str { trim_right ( self ) }
2209
+ fn trim_right ( ) -> ~str { trim_right ( self ) }
2212
2210
2213
2211
#[ inline]
2214
2212
pure fn to_unique ( ) -> ~str { self . slice ( 0 , self . len ( ) ) }
0 commit comments