about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-04-08 16:50:34 -0400
committerAlex Crichton <alex@alexcrichton.com>2013-04-08 17:50:25 -0400
commit255193cc1af5e07753906ad18bae077b45b5c3f0 (patch)
treef4e9111de1ff4bca239408f6bd0e0518227930e1 /src/libsyntax/parse
parent3136fba5aeca9184c944829596b93e45886fecf2 (diff)
downloadrust-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.rs10
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