Rename std::str::unsafe_from_bytes_ivec to unsafe_from_bytes
This commit is contained in:
parent
6050e1d4f6
commit
740196987e
15 changed files with 32 additions and 32 deletions
|
|
@ -105,7 +105,7 @@ fn parse_input_src(sess: session::session, cfg: &ast::crate_cfg,
|
|||
} else {
|
||||
ioivec::stdin()
|
||||
}.read_whole_stream();
|
||||
let src = str::unsafe_from_bytes_ivec(srcbytes);
|
||||
let src = str::unsafe_from_bytes(srcbytes);
|
||||
let crate = parser::parse_crate_from_source_str(infile, src, cfg,
|
||||
sess.get_parse_sess());
|
||||
ret {crate: crate, src: src};
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ fn item_family(item: &ebmlivec::doc) -> u8 {
|
|||
|
||||
fn item_symbol(item: &ebmlivec::doc) -> str {
|
||||
let sym = ebmlivec::get_doc(item, tag_items_data_item_symbol);
|
||||
ret str::unsafe_from_bytes_ivec(ebmlivec::doc_data(sym));
|
||||
ret str::unsafe_from_bytes(ebmlivec::doc_data(sym));
|
||||
}
|
||||
|
||||
fn variant_tag_id(d: &ebmlivec::doc) -> ast::def_id {
|
||||
|
|
@ -149,7 +149,7 @@ fn tag_variant_ids(item: &ebmlivec::doc, this_cnum: ast::crate_num) ->
|
|||
// definition the path refers to.
|
||||
fn resolve_path(path: &[ast::ident], data: @[u8]) -> [ast::def_id] {
|
||||
fn eq_item(data: &[u8], s: str) -> bool {
|
||||
ret str::eq(str::unsafe_from_bytes_ivec(data), s);
|
||||
ret str::eq(str::unsafe_from_bytes(data), s);
|
||||
}
|
||||
let s = str::connect_ivec(path, "::");
|
||||
let md = ebmlivec::new_doc(data);
|
||||
|
|
@ -270,7 +270,7 @@ fn read_path(d: &ebmlivec::doc) -> {path: str, pos: uint} {
|
|||
let desc = ebmlivec::doc_data(d);
|
||||
let pos = ebmlivec::be_uint_from_bytes(@desc, 0u, 4u);
|
||||
let pathbytes = ivec::slice[u8](desc, 4u, ivec::len[u8](desc));
|
||||
let path = str::unsafe_from_bytes_ivec(pathbytes);
|
||||
let path = str::unsafe_from_bytes(pathbytes);
|
||||
ret {path: path, pos: pos};
|
||||
}
|
||||
|
||||
|
|
@ -299,15 +299,15 @@ fn get_meta_items(md: &ebmlivec::doc) -> [@ast::meta_item] {
|
|||
for each meta_item_doc: ebmlivec::doc in
|
||||
ebmlivec::tagged_docs(md, tag_meta_item_word) {
|
||||
let nd = ebmlivec::get_doc(meta_item_doc, tag_meta_item_name);
|
||||
let n = str::unsafe_from_bytes_ivec(ebmlivec::doc_data(nd));
|
||||
let n = str::unsafe_from_bytes(ebmlivec::doc_data(nd));
|
||||
items += ~[attr::mk_word_item(n)];
|
||||
}
|
||||
for each meta_item_doc: ebmlivec::doc in
|
||||
ebmlivec::tagged_docs(md, tag_meta_item_name_value) {
|
||||
let nd = ebmlivec::get_doc(meta_item_doc, tag_meta_item_name);
|
||||
let vd = ebmlivec::get_doc(meta_item_doc, tag_meta_item_value);
|
||||
let n = str::unsafe_from_bytes_ivec(ebmlivec::doc_data(nd));
|
||||
let v = str::unsafe_from_bytes_ivec(ebmlivec::doc_data(vd));
|
||||
let n = str::unsafe_from_bytes(ebmlivec::doc_data(nd));
|
||||
let v = str::unsafe_from_bytes(ebmlivec::doc_data(vd));
|
||||
// FIXME (#611): Should be able to decode meta_name_value variants,
|
||||
// but currently they can't be encoded
|
||||
items += ~[attr::mk_name_value_item_str(n, v)];
|
||||
|
|
@ -315,7 +315,7 @@ fn get_meta_items(md: &ebmlivec::doc) -> [@ast::meta_item] {
|
|||
for each meta_item_doc: ebmlivec::doc in
|
||||
ebmlivec::tagged_docs(md, tag_meta_item_list) {
|
||||
let nd = ebmlivec::get_doc(meta_item_doc, tag_meta_item_name);
|
||||
let n = str::unsafe_from_bytes_ivec(ebmlivec::doc_data(nd));
|
||||
let n = str::unsafe_from_bytes(ebmlivec::doc_data(nd));
|
||||
let subitems = get_meta_items(meta_item_doc);
|
||||
items += ~[attr::mk_list_item(n, subitems)];
|
||||
}
|
||||
|
|
@ -372,7 +372,7 @@ fn get_crate_deps(data: @[u8]) -> [crate_dep] {
|
|||
let crate_num = 1;
|
||||
for each depdoc: ebmlivec::doc in
|
||||
ebmlivec::tagged_docs(depsdoc, tag_crate_dep) {
|
||||
let depname = str::unsafe_from_bytes_ivec(ebmlivec::doc_data(depdoc));
|
||||
let depname = str::unsafe_from_bytes(ebmlivec::doc_data(depdoc));
|
||||
deps += ~[{cnum: crate_num, ident: depname}];
|
||||
crate_num += 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ fn sanitize(s: &str) -> str {
|
|||
c != ' ' as u8 && c != '\t' as u8 && c != ';' as u8
|
||||
{
|
||||
let v = ~[c];
|
||||
result += str::unsafe_from_bytes_ivec(v);
|
||||
result += str::unsafe_from_bytes(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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_ivec(~[c as u8]);
|
||||
rslt += str::unsafe_from_bytes(~[c as u8]);
|
||||
rdr.bump();
|
||||
c = rdr.curr();
|
||||
if c == '-' || c == '+' {
|
||||
rslt += str::unsafe_from_bytes_ivec(~[c as u8]);
|
||||
rslt += str::unsafe_from_bytes(~[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_ivec(~[c as u8]); }
|
||||
if c != '_' { rslt += str::unsafe_from_bytes(~[c as u8]); }
|
||||
rdr.bump();
|
||||
c = rdr.curr();
|
||||
}
|
||||
|
|
@ -711,7 +711,7 @@ type lit = {lit: str, pos: uint};
|
|||
fn gather_comments_and_literals(cm: &codemap::codemap, path: str,
|
||||
srdr: ioivec::reader) ->
|
||||
{cmnts: [cmnt], lits: [lit]} {
|
||||
let src = str::unsafe_from_bytes_ivec(srdr.read_whole_stream());
|
||||
let src = str::unsafe_from_bytes(srdr.read_whole_stream());
|
||||
let itr = @interner::mk[str](str::hash, str::eq);
|
||||
let rdr = new_reader(cm, src, codemap::new_filemap(path, 0u, 0u), itr);
|
||||
let comments: [cmnt] = ~[];
|
||||
|
|
|
|||
|
|
@ -1386,7 +1386,7 @@ fn print_literal(s: &ps, lit: &@ast::lit) {
|
|||
}
|
||||
ast::lit_char(ch) {
|
||||
word(s.s, "'" + escape_str(
|
||||
str::unsafe_from_bytes_ivec(~[ch as u8]), '\'') + "'");
|
||||
str::unsafe_from_bytes(~[ch as u8]), '\'') + "'");
|
||||
}
|
||||
ast::lit_int(val) { word(s.s, int::str(val)); }
|
||||
ast::lit_uint(val) { word(s.s, uint::str(val) + "u"); }
|
||||
|
|
|
|||
|
|
@ -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_ivec(~[('a' as u8) + (id as u8)]);
|
||||
s += "'" + str::unsafe_from_bytes(~[('a' as u8) + (id as u8)]);
|
||||
}
|
||||
_ { s += ty_to_short_str(cx, typ); }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue