From 6156bc56cbd1f40e538b59ff91ce9b8d89969ff3 Mon Sep 17 00:00:00 2001 From: Kevin Cantu Date: Wed, 1 Feb 2012 03:41:58 -0800 Subject: Propagating unsafe::slice 2 --- src/comp/syntax/parse/lexer.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/comp/syntax/parse') 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); -- cgit 1.4.1-3-g733a5