mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-10 14:57:14 +00:00
Remove str_from_vec runtime function
This commit is contained in:
parent
740196987e
commit
878fbac278
@ -64,7 +64,6 @@ native "rust" mod rustrt {
|
||||
fn str_byte_len(s: str) -> uint;
|
||||
fn str_alloc(n_bytes: uint) -> str;
|
||||
fn str_from_ivec(b: &[mutable? u8]) -> str;
|
||||
fn str_from_vec(b: vec[mutable? u8]) -> str;
|
||||
fn str_from_cstr(cstr: sbuf) -> str;
|
||||
fn str_from_buf(buf: sbuf, len: uint) -> str;
|
||||
fn str_push_byte(s: str, byte: uint) -> str;
|
||||
@ -196,7 +195,7 @@ fn unsafe_from_bytes(v: &[mutable? u8]) -> str {
|
||||
ret rustrt::str_from_ivec(v);
|
||||
}
|
||||
|
||||
fn unsafe_from_byte(u: u8) -> str { ret rustrt::str_from_vec([u]); }
|
||||
fn unsafe_from_byte(u: u8) -> str { ret rustrt::str_from_ivec(~[u]); }
|
||||
|
||||
fn str_from_cstr(cstr: sbuf) -> str { ret rustrt::str_from_cstr(cstr); }
|
||||
|
||||
|
@ -304,23 +304,6 @@ str_from_ivec(rust_task *task, rust_ivec *v)
|
||||
return st;
|
||||
}
|
||||
|
||||
extern "C" CDECL rust_str *
|
||||
str_from_vec(rust_task *task, rust_vec *v)
|
||||
{
|
||||
rust_str *st =
|
||||
vec_alloc_with_data(task,
|
||||
v->fill + 1, // +1 to fit at least '\0'
|
||||
v->fill,
|
||||
1,
|
||||
v->fill ? (void*)v->data : NULL);
|
||||
if (!st) {
|
||||
task->fail();
|
||||
return NULL;
|
||||
}
|
||||
st->data[st->fill++] = '\0';
|
||||
return st;
|
||||
}
|
||||
|
||||
extern "C" CDECL rust_str *
|
||||
str_from_cstr(rust_task *task, char *sbuf)
|
||||
{
|
||||
|
@ -65,7 +65,6 @@ str_byte_len
|
||||
str_from_buf
|
||||
str_from_cstr
|
||||
str_from_ivec
|
||||
str_from_vec
|
||||
str_push_byte
|
||||
str_slice
|
||||
take_chan
|
||||
|
Loading…
Reference in New Issue
Block a user