diff options
| author | Kevin Cantu <me@kevincantu.org> | 2012-02-01 03:41:58 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-02-01 21:56:53 -0800 |
| commit | 6156bc56cbd1f40e538b59ff91ce9b8d89969ff3 (patch) | |
| tree | ec399916523a701e8ac25903855e90d2210a9254 /src/comp/syntax | |
| parent | 47c57a17dc51ff32594b5759c300b84e380b9f7b (diff) | |
| download | rust-6156bc56cbd1f40e538b59ff91ce9b8d89969ff3.tar.gz rust-6156bc56cbd1f40e538b59ff91ce9b8d89969ff3.zip | |
Propagating unsafe::slice 2
Diffstat (limited to 'src/comp/syntax')
| -rw-r--r-- | src/comp/syntax/parse/lexer.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/comp/syntax/parse/lexer.rs b/src/comp/syntax/parse/lexer.rs index 03fc4017106..d4e67e812d1 100644 --- a/src/comp/syntax/parse/lexer.rs +++ b/src/comp/syntax/parse/lexer.rs @@ -24,10 +24,10 @@ type reader = @{ impl reader for reader { fn is_eof() -> bool { self.curr == -1 as char } - fn get_str_from(start: uint) -> str { + fn get_str_from(start: uint) -> str unsafe { // I'm pretty skeptical about this subtraction. What if there's a // multi-byte character before the mark? - ret str::slice(*self.src, start - 1u, self.pos - 1u); + ret str::unsafe::slice(*self.src, start - 1u, self.pos - 1u); } fn next() -> char { if self.pos < self.len { @@ -579,11 +579,11 @@ fn all_whitespace(s: str, begin: uint, end: uint) -> bool { ret true; } -fn trim_whitespace_prefix_and_push_line(&lines: [str], s: str, col: uint) { +fn trim_whitespace_prefix_and_push_line(&lines: [str], s: str, col: uint) unsafe { let s1; if all_whitespace(s, 0u, col) { if col < str::byte_len(s) { - s1 = str::slice(s, col, str::byte_len(s)); + s1 = str::unsafe::slice(s, col, str::byte_len(s)); } else { s1 = ""; } } else { s1 = s; } log(debug, "pushing line: " + s1); |
