about summary refs log tree commit diff
path: root/src/comp/syntax
diff options
context:
space:
mode:
authorErick Tryzelaar <erick.tryzelaar@gmail.com>2012-02-15 18:26:10 -0800
committerErick Tryzelaar <erick.tryzelaar@gmail.com>2012-02-16 18:35:45 -0800
commit042a5222d1f324a60b61bbc58f3938770d3e0cd0 (patch)
tree2e3ab04c32b278bed873fd6b31d8dcedc0c0fedb /src/comp/syntax
parentd1c9b160adf5f13bca690e114f254b5353fe798d (diff)
downloadrust-042a5222d1f324a60b61bbc58f3938770d3e0cd0.tar.gz
rust-042a5222d1f324a60b61bbc58f3938770d3e0cd0.zip
core: rewrite str::byte_index to use vec functions
Diffstat (limited to 'src/comp/syntax')
-rw-r--r--src/comp/syntax/codemap.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/comp/syntax/codemap.rs b/src/comp/syntax/codemap.rs
index 7e153839448..744ea97441d 100644
--- a/src/comp/syntax/codemap.rs
+++ b/src/comp/syntax/codemap.rs
@@ -157,7 +157,8 @@ fn span_to_lines(sp: span, cm: codemap::codemap) -> @file_lines {
 
 fn get_line(fm: filemap, line: int) -> str unsafe {
     let begin: uint = fm.lines[line].byte - fm.start_pos.byte;
-    let end = alt str::byte_index(*fm.src, '\n' as u8, begin) {
+    let end = alt str::byte_index_from(*fm.src, '\n' as u8, begin,
+                                  str::len(*fm.src)) {
       some(e) { e }
       none { str::len(*fm.src) }
     };