summary refs log tree commit diff
path: root/src/comp/syntax
diff options
context:
space:
mode:
authorKevin Cantu <me@kevincantu.org>2012-02-01 04:20:21 -0800
committerBrian Anderson <banderson@mozilla.com>2012-02-01 21:56:53 -0800
commit8f367ebfeb4f0b897b386f5c74c4f329fb8cbd54 (patch)
tree9796d775541b468b23646f034b028225c9cbce72 /src/comp/syntax
parent01c01f68afc58bc9a7a4d4b85805925d45a39ec7 (diff)
downloadrust-8f367ebfeb4f0b897b386f5c74c4f329fb8cbd54.tar.gz
rust-8f367ebfeb4f0b897b386f5c74c4f329fb8cbd54.zip
Rename (again) str::unsafe::slice -> str::unsafe::slice_bytes and
str::unsafe::safe_slice -> str::unsafe::slice_bytes_safe_range
Diffstat (limited to 'src/comp/syntax')
-rw-r--r--src/comp/syntax/codemap.rs4
-rw-r--r--src/comp/syntax/parse/lexer.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/comp/syntax/codemap.rs b/src/comp/syntax/codemap.rs
index eab92ab6ae9..eb6d1fd1d9d 100644
--- a/src/comp/syntax/codemap.rs
+++ b/src/comp/syntax/codemap.rs
@@ -118,11 +118,11 @@ fn get_line(fm: filemap, line: int) -> str unsafe {
         // parsed. If we just slice the rest of the string, we'll print out
         // the remainder of the file, which is undesirable.
         end = str::byte_len(*fm.src);
-        let rest = str::unsafe::slice(*fm.src, begin, end);
+        let rest = str::unsafe::slice_bytes(*fm.src, begin, end);
         let newline = str::index(rest, '\n' as u8);
         if newline != -1 { end = begin + (newline as uint); }
     }
-    ret str::unsafe::slice(*fm.src, begin, end);
+    ret str::unsafe::slice_bytes(*fm.src, begin, end);
 }
 
 fn get_filemap(cm: codemap, filename: str) -> filemap {
diff --git a/src/comp/syntax/parse/lexer.rs b/src/comp/syntax/parse/lexer.rs
index 30dacd27d4e..4d7ee27eb9d 100644
--- a/src/comp/syntax/parse/lexer.rs
+++ b/src/comp/syntax/parse/lexer.rs
@@ -27,7 +27,7 @@ impl reader for reader {
     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::unsafe::slice(*self.src, start - 1u, self.pos - 1u);
+        ret str::unsafe::slice_bytes(*self.src, start - 1u, self.pos - 1u);
     }
     fn next() -> char {
         if self.pos < self.len {
@@ -584,7 +584,7 @@ fn trim_whitespace_prefix_and_push_line(&lines: [str],
     let s1;
     if all_whitespace(s, 0u, col) {
         if col < str::byte_len(s) {
-            s1 = str::unsafe::slice(s, col, str::byte_len(s));
+            s1 = str::unsafe::slice_bytes(s, col, str::byte_len(s));
         } else { s1 = ""; }
     } else { s1 = s; }
     log(debug, "pushing line: " + s1);