Replacing str::unsafe_from_bytes with str::from_bytes (part 1)

This commit is contained in:
Kevin Cantu
2012-01-25 00:53:17 -08:00
parent 9750e83a17
commit c7b23f9a86
10 changed files with 16 additions and 11 deletions

View File

@@ -440,6 +440,7 @@ mod rt {
let head = s[0];
if head == '+' as u8 || head == '-' as u8 || head == ' ' as u8 {
let headstr = str::unsafe_from_bytes([head]);
// FIXME: not UTF-8 safe
let bytelen = str::byte_len(s);
let numpart = str::substr(s, 1u, bytelen - 1u);
ret headstr + padstr + numpart;