diff options
Diffstat (limited to 'src/libsyntax/codemap.rs')
| -rw-r--r-- | src/libsyntax/codemap.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 5f8d6e73cef..52f6e458db3 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -290,9 +290,9 @@ impl FileMap { let begin = begin.to_uint(); let end = match str::find_char_from(*self.src, '\n', begin) { Some(e) => e, - None => str::len(*self.src) + None => self.src.len() }; - str::slice(*self.src, begin, end).to_owned() + self.src.slice(begin, end).to_owned() } pub fn record_multibyte_char(&self, pos: BytePos, bytes: uint) { @@ -418,7 +418,7 @@ impl CodeMap { let begin = self.lookup_byte_offset(sp.lo); let end = self.lookup_byte_offset(sp.hi); assert_eq!(begin.fm.start_pos, end.fm.start_pos); - return str::slice(*begin.fm.src, + return begin.fm.src.slice( begin.pos.to_uint(), end.pos.to_uint()).to_owned(); } |
