about summary refs log tree commit diff
path: root/src/compiletest/errors.rs
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2013-11-07 18:59:40 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2013-11-08 10:20:06 +1100
commitb95a8c63fd7f89d38dc5ddee106cb0865274874e (patch)
treec76794d120c73760762c6a115dd7462ed38ef3de /src/compiletest/errors.rs
parent7fc689305cd38a0168ed5b139f4c118f81e2217e (diff)
downloadrust-b95a8c63fd7f89d38dc5ddee106cb0865274874e.tar.gz
rust-b95a8c63fd7f89d38dc5ddee106cb0865274874e.zip
std::ascii: Provide a copyless [Ascii] -> str method.
This renames to_str_ascii to as_str_ascii and makes it non-copying,
which is possible now that strings no longer have a hidden extra
byte/null terminator.

Fixes #6120.
Diffstat (limited to 'src/compiletest/errors.rs')
-rw-r--r--src/compiletest/errors.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/compiletest/errors.rs b/src/compiletest/errors.rs
index 8bfef9da805..dcb0d2ef01d 100644
--- a/src/compiletest/errors.rs
+++ b/src/compiletest/errors.rs
@@ -52,10 +52,8 @@ fn parse_expected(line_num: uint, line: ~str) -> ~[ExpectedError] {
     let start_kind = idx;
     while idx < len && line[idx] != (' ' as u8) { idx += 1u; }
 
-    // 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.
     let kind = line.slice(start_kind, idx);
-    let kind = kind.to_ascii().to_lower().to_str_ascii();
+    let kind = kind.to_ascii().to_lower().into_str();
 
     // Extract msg:
     while idx < len && line[idx] == (' ' as u8) { idx += 1u; }