libsyntax: Remove fn() unsafe { ... }. r=graydon

This commit is contained in:
Patrick Walton 2013-01-23 11:43:58 -08:00
parent 1d1b81143b
commit 54b2cad8b3
59 changed files with 2807 additions and 2425 deletions

View file

@ -208,14 +208,16 @@ pub impl FileMap {
self.lines.push(pos);
}
pub fn get_line(&self, line: int) -> ~str unsafe {
let begin: BytePos = self.lines[line] - self.start_pos;
let begin = begin.to_uint();
let end = match str::find_char_from(*self.src, '\n', begin) {
Some(e) => e,
None => str::len(*self.src)
};
str::slice(*self.src, begin, end)
pub fn get_line(&self, line: int) -> ~str {
unsafe {
let begin: BytePos = self.lines[line] - self.start_pos;
let begin = begin.to_uint();
let end = match str::find_char_from(*self.src, '\n', begin) {
Some(e) => e,
None => str::len(*self.src)
};
str::slice(*self.src, begin, end)
}
}
pub fn record_multibyte_char(&self, pos: BytePos, bytes: uint) {