diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-04-08 16:50:34 -0400 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-04-08 17:50:25 -0400 |
| commit | 255193cc1af5e07753906ad18bae077b45b5c3f0 (patch) | |
| tree | f4e9111de1ff4bca239408f6bd0e0518227930e1 /src/libsyntax/parse | |
| parent | 3136fba5aeca9184c944829596b93e45886fecf2 (diff) | |
| download | rust-255193cc1af5e07753906ad18bae077b45b5c3f0.tar.gz rust-255193cc1af5e07753906ad18bae077b45b5c3f0.zip | |
Removing no longer needed unsafe blocks
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/lexer.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index 5e06ecf6090..de3d97de177 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -175,12 +175,10 @@ fn byte_offset(rdr: @mut StringReader) -> BytePos { } pub fn get_str_from(rdr: @mut StringReader, start: BytePos) -> ~str { - unsafe { - // I'm pretty skeptical about this subtraction. What if there's a - // multi-byte character before the mark? - return str::slice(*rdr.src, start.to_uint() - 1u, - byte_offset(rdr).to_uint() - 1u).to_owned(); - } + // I'm pretty skeptical about this subtraction. What if there's a + // multi-byte character before the mark? + return str::slice(*rdr.src, start.to_uint() - 1u, + byte_offset(rdr).to_uint() - 1u).to_owned(); } // EFFECT: advance the StringReader by one character. If a newline is |
