diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-01-30 14:28:44 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-02-03 09:32:35 -0800 |
| commit | 2a7c5e0b724d8318a7e7762e483c225e8a7420a1 (patch) | |
| tree | 59b1cdf662cc23707721e09f1080da870301136b /src/libsyntax/util/parser_testing.rs | |
| parent | 94f2dfa8f632542bfb7260ca4b0aadce24061592 (diff) | |
| download | rust-2a7c5e0b724d8318a7e7762e483c225e8a7420a1.tar.gz rust-2a7c5e0b724d8318a7e7762e483c225e8a7420a1.zip | |
syntax: Remove usage of io_error in tests
Diffstat (limited to 'src/libsyntax/util/parser_testing.rs')
| -rw-r--r-- | src/libsyntax/util/parser_testing.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libsyntax/util/parser_testing.rs b/src/libsyntax/util/parser_testing.rs index 58c2bed7a45..aa22f47221b 100644 --- a/src/libsyntax/util/parser_testing.rs +++ b/src/libsyntax/util/parser_testing.rs @@ -101,30 +101,30 @@ pub fn matches_codepattern(a : &str, b : &str) -> bool { let mut idx_a = 0; let mut idx_b = 0; loop { - if (idx_a == a.len() && idx_b == b.len()) { + if idx_a == a.len() && idx_b == b.len() { return true; } - else if (idx_a == a.len()) {return false;} - else if (idx_b == b.len()) { + else if idx_a == a.len() {return false;} + else if idx_b == b.len() { // maybe the stuff left in a is all ws? - if (is_whitespace(a.char_at(idx_a))) { - return (scan_for_non_ws_or_end(a,idx_a) == a.len()); + if is_whitespace(a.char_at(idx_a)) { + return scan_for_non_ws_or_end(a,idx_a) == a.len(); } else { return false; } } // ws in both given and pattern: - else if (is_whitespace(a.char_at(idx_a)) - && is_whitespace(b.char_at(idx_b))) { + else if is_whitespace(a.char_at(idx_a)) + && is_whitespace(b.char_at(idx_b)) { idx_a = scan_for_non_ws_or_end(a,idx_a); idx_b = scan_for_non_ws_or_end(b,idx_b); } // ws in given only: - else if (is_whitespace(a.char_at(idx_a))) { + else if is_whitespace(a.char_at(idx_a)) { idx_a = scan_for_non_ws_or_end(a,idx_a); } // *don't* silently eat ws in expected only. - else if (a.char_at(idx_a) == b.char_at(idx_b)) { + else if a.char_at(idx_a) == b.char_at(idx_b) { idx_a += 1; idx_b += 1; } |
