summary refs log tree commit diff
path: root/src/libcore/num
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2013-02-28 16:48:22 -0800
committerTim Chevalier <chevalier@alum.wellesley.edu>2013-02-28 16:49:02 -0800
commit405a35c7f8cfaa9c77e71111a184e86d5ea4d637 (patch)
treec194f926ca89acb50ec24f349b0191178b1e45d5 /src/libcore/num
parent5680ec027088c57f8b9fa3a9aa91daaf2428a57c (diff)
downloadrust-405a35c7f8cfaa9c77e71111a184e86d5ea4d637.tar.gz
rust-405a35c7f8cfaa9c77e71111a184e86d5ea4d637.zip
core: Address XXX, make static constants for strings used when stringifying floats
Diffstat (limited to 'src/libcore/num')
-rw-r--r--src/libcore/num/strconv.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libcore/num/strconv.rs b/src/libcore/num/strconv.rs
index 4322ea40428..50fc1b03ccc 100644
--- a/src/libcore/num/strconv.rs
+++ b/src/libcore/num/strconv.rs
@@ -478,17 +478,16 @@ pub pure fn from_str_bytes_common<T:NumCast+Zero+One+Ord+Copy+Div<T,T>+
         }
     }
 
-    // XXX: Bytevector constant from str
     if special {
-        if buf == str::to_bytes("inf") || buf == str::to_bytes("+inf") {
+        if buf == str::inf_buf || buf == str::positive_inf_buf {
             return NumStrConv::inf();
-        } else if buf == str::to_bytes("-inf") {
+        } else if buf == str::negative_inf_buf {
             if negative {
                 return NumStrConv::neg_inf();
             } else {
                 return None;
             }
-        } else if buf == str::to_bytes("NaN") {
+        } else if buf == str::nan_buf {
             return NumStrConv::NaN();
         }
     }