diff options
| author | Kevin Cantu <me@kevincantu.org> | 2012-02-12 22:00:56 -0800 |
|---|---|---|
| committer | Kevin Cantu <me@kevincantu.org> | 2012-02-13 01:56:58 -0800 |
| commit | c81867474a2cac8fcb646390ae5f3782dda45aae (patch) | |
| tree | 69b3cf2bf0b51eb664349599399d8a4ec379f705 /src/compiletest/errors.rs | |
| parent | 748b63f63f4fb2ac8583900adb5a283990be276b (diff) | |
| download | rust-c81867474a2cac8fcb646390ae5f3782dda45aae.tar.gz rust-c81867474a2cac8fcb646390ae5f3782dda45aae.zip | |
(core::str) add find_bytes and export it...
Diffstat (limited to 'src/compiletest/errors.rs')
| -rw-r--r-- | src/compiletest/errors.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/compiletest/errors.rs b/src/compiletest/errors.rs index 9d81b6f00e2..f6b32e2fd31 100644 --- a/src/compiletest/errors.rs +++ b/src/compiletest/errors.rs @@ -24,9 +24,11 @@ fn load_errors(testfile: str) -> [expected_error] { fn parse_expected(line_num: uint, line: str) -> [expected_error] unsafe { let error_tag = "//!"; - let idx0 = str::find(line, error_tag); - if idx0 < 0 { ret []; } - let idx = (idx0 as uint) + str::len_bytes(error_tag); + let idx; + alt str::find_bytes(line, error_tag) { + option::none { ret []; } + option::some(nn) { idx = (nn as uint) + str::len_bytes(error_tag); } + } // "//!^^^ kind msg" denotes a message expected // three lines above current line: |
