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; }