about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
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
         }