diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-10 00:44:58 +1000 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-10 23:02:54 +1000 |
| commit | c32fb53cf9ae20a657d17bd8e2f0b36863096583 (patch) | |
| tree | 928280b4bfcde6b9765de76f956624a735eafde9 /src/compiletest/errors.rs | |
| parent | b29cd22bce6325a60788ab84f989bd2e82fcaaf4 (diff) | |
| download | rust-c32fb53cf9ae20a657d17bd8e2f0b36863096583.tar.gz rust-c32fb53cf9ae20a657d17bd8e2f0b36863096583.zip | |
std: remove str::{len, slice, is_empty} in favour of methods.
Diffstat (limited to 'src/compiletest/errors.rs')
| -rw-r--r-- | src/compiletest/errors.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiletest/errors.rs b/src/compiletest/errors.rs index 728548caf77..575df0268d6 100644 --- a/src/compiletest/errors.rs +++ b/src/compiletest/errors.rs @@ -33,13 +33,13 @@ fn parse_expected(line_num: uint, line: ~str) -> ~[ExpectedError] { let mut idx; match str::find_str(line, error_tag) { None => return ~[], - Some(nn) => { idx = (nn as uint) + str::len(error_tag); } + Some(nn) => { idx = (nn as uint) + error_tag.len(); } } // "//~^^^ kind msg" denotes a message expected // three lines above current line: let mut adjust_line = 0u; - let len = str::len(line); + let len = line.len(); while idx < len && line[idx] == ('^' as u8) { adjust_line += 1u; idx += 1u; @@ -52,12 +52,12 @@ fn parse_expected(line_num: uint, line: ~str) -> ~[ExpectedError] { // 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 = str::slice(line, start_kind, idx); + let kind = line.slice(start_kind, idx); let kind = kind.to_ascii().to_lower().to_str_ascii(); // Extract msg: while idx < len && line[idx] == (' ' as u8) { idx += 1u; } - let msg = str::slice(line, idx, len).to_owned(); + let msg = line.slice(idx, len).to_owned(); debug!("line=%u kind=%s msg=%s", line_num - adjust_line, kind, msg); |
