Fix signature and add string_reader to ioivec.

This commit is contained in:
Graydon Hoare 2011-07-25 14:04:01 -07:00
parent 6bcdb48e35
commit 5749a2deac

View File

@ -220,10 +220,14 @@ fn seek(int offset, seek_style whence) {
fn tell() -> uint { ret bbuf.pos; }
}
fn new_byte_buf_reader(&u8[] buf) -> byte_buf_reader {
fn new_byte_buf_reader(&u8[] buf) -> buf_reader {
ret byte_buf_reader(@rec(buf=buf, mutable pos=0u));
}
fn string_reader(&str s) -> reader {
ret new_reader(new_byte_buf_reader(str::bytes_ivec(s)));
}
// Writing
tag fileflag { append; create; truncate; none; }