about summary refs log tree commit diff
path: root/src/libsyntax/parse/lexer.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-05-19 17:23:26 -0700
committerPatrick Walton <pcwalton@mimiga.net>2014-05-22 14:42:02 -0700
commit5633d4641f7d63805e3c12c899f8401410bd825f (patch)
treef391ab3aedba4112c3bc36b796eee62d1e850fa4 /src/libsyntax/parse/lexer.rs
parenta9dd903d79b053eb85302572e53717ad865c813d (diff)
downloadrust-5633d4641f7d63805e3c12c899f8401410bd825f.tar.gz
rust-5633d4641f7d63805e3c12c899f8401410bd825f.zip
libstd: Remove all uses of `~str` from `libstd`
Diffstat (limited to 'src/libsyntax/parse/lexer.rs')
-rw-r--r--src/libsyntax/parse/lexer.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs
index c78d2aaf3a7..5a7a816dbb3 100644
--- a/src/libsyntax/parse/lexer.rs
+++ b/src/libsyntax/parse/lexer.rs
@@ -589,13 +589,13 @@ fn scan_number(c: char, rdr: &mut StringReader) -> token::Token {
             bump(rdr);
             bump(rdr);
             check_float_base(rdr, start_bpos, rdr.last_pos, base);
-            return token::LIT_FLOAT(str_to_ident(num_str.into_owned()),
+            return token::LIT_FLOAT(str_to_ident(num_str.as_slice()),
                                     ast::TyF32);
         } else if c == '6' && n == '4' {
             bump(rdr);
             bump(rdr);
             check_float_base(rdr, start_bpos, rdr.last_pos, base);
-            return token::LIT_FLOAT(str_to_ident(num_str.into_owned()),
+            return token::LIT_FLOAT(str_to_ident(num_str.as_slice()),
                                     ast::TyF64);
             /* FIXME (#2252): if this is out of range for either a
             32-bit or 64-bit float, it won't be noticed till the
@@ -612,8 +612,7 @@ fn scan_number(c: char, rdr: &mut StringReader) -> token::Token {
     }
     if is_float {
         check_float_base(rdr, start_bpos, rdr.last_pos, base);
-        return token::LIT_FLOAT_UNSUFFIXED(str_to_ident(
-                num_str.into_owned()));
+        return token::LIT_FLOAT_UNSUFFIXED(str_to_ident(num_str.as_slice()));
     } else {
         if num_str.len() == 0u {
             fatal_span(rdr, start_bpos, rdr.last_pos,