Skip to content

Commit f6d50d8

Browse files
committed
libcore: Make to_upper() and to_lower() pure
1 parent d155410 commit f6d50d8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libcore/str.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,8 +2160,8 @@ trait StrSlice {
21602160
fn split_str(sep: &a/str) -> ~[~str];
21612161
fn starts_with(needle: &a/str) -> bool;
21622162
fn substr(begin: uint, n: uint) -> ~str;
2163-
fn to_lower() -> ~str;
2164-
fn to_upper() -> ~str;
2163+
pure fn to_lower() -> ~str;
2164+
pure fn to_upper() -> ~str;
21652165
fn escape_default() -> ~str;
21662166
fn escape_unicode() -> ~str;
21672167
pure fn to_unique() -> ~str;
@@ -2262,10 +2262,10 @@ impl &str: StrSlice {
22622262
fn substr(begin: uint, n: uint) -> ~str { substr(self, begin, n) }
22632263
/// Convert a string to lowercase
22642264
#[inline]
2265-
fn to_lower() -> ~str { to_lower(self) }
2265+
pure fn to_lower() -> ~str { to_lower(self) }
22662266
/// Convert a string to uppercase
22672267
#[inline]
2268-
fn to_upper() -> ~str { to_upper(self) }
2268+
pure fn to_upper() -> ~str { to_upper(self) }
22692269
/// Escape each char in `s` with char::escape_default.
22702270
#[inline]
22712271
fn escape_default() -> ~str { escape_default(self) }

0 commit comments

Comments
 (0)