about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKevin Cantu <me@kevincantu.org>2012-01-24 23:47:32 -0800
committerKevin Cantu <me@kevincantu.org>2012-01-24 23:47:32 -0800
commit9750e83a17a8f9f865eae757dcdccf374b1c82b7 (patch)
treea9047885382a5f8ba6e6606969c520b587d918b6
parent2496dccae4622cb5fea9ae8f54adb0b83eadaf07 (diff)
downloadrust-9750e83a17a8f9f865eae757dcdccf374b1c82b7.tar.gz
rust-9750e83a17a8f9f865eae757dcdccf374b1c82b7.zip
Replace uses of str::unsafe_from_byte
-rw-r--r--src/comp/metadata/tydecode.rs4
-rw-r--r--src/libcore/str.rs2
-rw-r--r--src/libcore/uint.rs4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/comp/metadata/tydecode.rs b/src/comp/metadata/tydecode.rs
index 2e4e5cdc66d..cbd11c1c1b9 100644
--- a/src/comp/metadata/tydecode.rs
+++ b/src/comp/metadata/tydecode.rs
@@ -39,7 +39,7 @@ fn parse_ident_(st: @pstate, is_last: fn@(char) -> bool) ->
    ast::ident {
     let rslt = "";
     while !is_last(peek(st) as char) {
-        rslt += str::unsafe_from_byte(next(st));
+        rslt += str::from_byte(next(st));
     }
     ret rslt;
 }
@@ -226,7 +226,7 @@ fn parse_ty(st: @pstate, conv: conv_did) -> ty::t {
         while peek(st) as char != ']' {
             let name = "";
             while peek(st) as char != '=' {
-                name += str::unsafe_from_byte(next(st));
+                name += str::from_byte(next(st));
             }
             st.pos = st.pos + 1u;
             fields += [{ident: name, mt: parse_mt(st, conv)}];
diff --git a/src/libcore/str.rs b/src/libcore/str.rs
index 5febb443828..36453d78c98 100644
--- a/src/libcore/str.rs
+++ b/src/libcore/str.rs
@@ -146,7 +146,7 @@ Function: unsafe_from_byte
 Converts a byte to a string. Does not verify that the byte is
 valid UTF-8.
 
-FIXME: rename to 'from_byte'
+FIXME: REMOVE.
 */
 fn unsafe_from_byte(u: u8) -> str { unsafe_from_bytes([u]) }
 
diff --git a/src/libcore/uint.rs b/src/libcore/uint.rs
index 8d032610e17..2112399ba80 100644
--- a/src/libcore/uint.rs
+++ b/src/libcore/uint.rs
@@ -236,12 +236,12 @@ fn to_str(num: uint, radix: uint) -> str {
     if n == 0u { ret "0"; }
     let s: str = "";
     while n != 0u {
-        s += str::unsafe_from_byte(digit(n % radix) as u8);
+        s += str::from_byte(digit(n % radix) as u8);
         n /= radix;
     }
     let s1: str = "";
     let len: uint = str::byte_len(s);
-    while len != 0u { len -= 1u; s1 += str::unsafe_from_byte(s[len]); }
+    while len != 0u { len -= 1u; s1 += str::from_byte(s[len]); }
     ret s1;
 }