Fix the signature on vec::view.

Due to limitations in region inference, this has the effect of making vec::view pretty much entirely unusable.
This commit is contained in:
Eric Holk 2012-07-12 10:47:37 -07:00
parent 1a276dba52
commit aba665da32
6 changed files with 19 additions and 11 deletions

View file

@ -122,8 +122,9 @@ fn tagged_docs(d: doc, tg: uint, it: fn(doc)) {
fn doc_data(d: doc) -> ~[u8] { vec::slice::<u8>(*d.data, d.start, d.end) }
fn with_doc_data<T>(d: doc, f: fn(x:&[u8]) -> T) -> T {
ret f(vec::view::<u8>(*d.data, d.start, d.end));
fn with_doc_data<T>(d: doc, f: fn(x: &[u8]) -> T) -> T {
// FIXME (#2880): use vec::view once the region inferencer can handle it.
ret f(vec::slice::<u8>(*d.data, d.start, d.end));
}
fn doc_as_str(d: doc) -> str { ret str::from_bytes(doc_data(d)); }