Convert all uses of unsafe_from_bytes to unsafe_from_bytes_ivec

This commit is contained in:
Brian Anderson 2011-08-11 17:02:13 -07:00
parent 49b80f9bf7
commit a9ce342fa3
11 changed files with 27 additions and 31 deletions

View file

@ -311,8 +311,8 @@ fn sanitize(s: &str) -> str {
if c != 10u8 && c != '}' as u8 && c != ')' as u8 &&
c != ' ' as u8 && c != '\t' as u8 && c != ';' as u8
{
let v = [c];
result += str::unsafe_from_bytes(v);
let v = ~[c];
result += str::unsafe_from_bytes_ivec(v);
}
}
}

View file

@ -177,11 +177,11 @@ fn scan_exponent(rdr: &reader) -> option::t[str] {
let c = rdr.curr();
let rslt = "";
if c == 'e' || c == 'E' {
rslt += str::unsafe_from_bytes([c as u8]);
rslt += str::unsafe_from_bytes_ivec(~[c as u8]);
rdr.bump();
c = rdr.curr();
if c == '-' || c == '+' {
rslt += str::unsafe_from_bytes([c as u8]);
rslt += str::unsafe_from_bytes_ivec(~[c as u8]);
rdr.bump();
}
let exponent = scan_dec_digits(rdr);
@ -195,7 +195,7 @@ fn scan_dec_digits(rdr: &reader) -> str {
let c = rdr.curr();
let rslt: str = "";
while is_dec_digit(c) || c == '_' {
if c != '_' { rslt += str::unsafe_from_bytes([c as u8]); }
if c != '_' { rslt += str::unsafe_from_bytes_ivec(~[c as u8]); }
rdr.bump();
c = rdr.curr();
}

View file

@ -1385,8 +1385,8 @@ fn print_literal(s: &ps, lit: &@ast::lit) {
print_string(s, st);
}
ast::lit_char(ch) {
word(s.s, "'" +
escape_str(str::unsafe_from_bytes([ch as u8]), '\'') + "'");
word(s.s, "'" + escape_str(
str::unsafe_from_bytes_ivec(~[ch as u8]), '\'') + "'");
}
ast::lit_int(val) { word(s.s, int::str(val)); }
ast::lit_uint(val) { word(s.s, uint::str(val) + "u"); }

View file

@ -132,7 +132,7 @@ fn ty_to_str(cx: &ctxt, typ: &t) -> str {
}
ty_var(v) { s += "<T" + int::str(v) + ">"; }
ty_param(id,_) {
s += "'" + str::unsafe_from_bytes([('a' as u8) + (id as u8)]);
s += "'" + str::unsafe_from_bytes_ivec(~[('a' as u8) + (id as u8)]);
}
_ { s += ty_to_short_str(cx, typ); }
}