libsyntax: Remove fn() unsafe { ... }
. r=graydon
This commit is contained in:
parent
1d1b81143b
commit
54b2cad8b3
59 changed files with 2807 additions and 2425 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue