about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-04-24 13:33:29 -0700
committerbors <bors@rust-lang.org>2013-04-24 13:33:29 -0700
commitee3789b4e434d90661601f00867da4980a74a676 (patch)
treefc406c99510acbf1fdeb9da2e25d3a38feb92fad /src/libstd
parente26f992d5e199a1ff8c26733650d254d63be066a (diff)
parent3759b5711d1f34a92ef51abd069f074fb55b3b5b (diff)
downloadrust-ee3789b4e434d90661601f00867da4980a74a676.tar.gz
rust-ee3789b4e434d90661601f00867da4980a74a676.zip
auto merge of #6029 : Kimundi/rust/ascii-encoding, r=thestinger
Replaced {str, char, u8}::is_ascii
Replaced str::to_lower and str::to_upper
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/semver.rs2
-rw-r--r--src/libstd/sort.rs8
2 files changed, 7 insertions, 3 deletions
diff --git a/src/libstd/semver.rs b/src/libstd/semver.rs
index 83fab365d8d..f6d1b1ba2ec 100644
--- a/src/libstd/semver.rs
+++ b/src/libstd/semver.rs
@@ -220,7 +220,7 @@ fn parse_reader(rdr: @io::Reader) -> Version {
 
 
 pub fn parse(s: &str) -> Option<Version> {
-    if ! str::is_ascii(s) {
+    if !s.is_ascii() {
         return None;
     }
     let s = s.trim();
diff --git a/src/libstd/sort.rs b/src/libstd/sort.rs
index db6efdf3f52..cc002bc8305 100644
--- a/src/libstd/sort.rs
+++ b/src/libstd/sort.rs
@@ -885,8 +885,12 @@ mod tests {
         // tjc: funny that we have to use parens
         fn ile(x: &(&'static str), y: &(&'static str)) -> bool
         {
-            let x = x.to_lower();
-            let y = y.to_lower();
+            // FIXME: #4318 Instead of to_ascii and to_str_ascii, could use
+            // to_ascii_consume and to_str_consume to not do a unnecessary copy.
+            // (Actually, could just remove the to_str_* call, but needs an deriving(Ord) on
+            // Ascii)
+            let x = x.to_ascii().to_lower().to_str_ascii();
+            let y = y.to_ascii().to_lower().to_str_ascii();
             x <= y
         }