Skip to content

Commit c15aa5e

Browse files
committed
stdlib: EBML API fixes
1 parent 3275cad commit c15aa5e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/lib/ebmlivec.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type ebml_state = rec(ebml_tag ebml_tag, uint tag_pos, uint data_pos);
1717
// ebml reading
1818
type doc = rec(@u8[] data, uint start, uint end);
1919

20-
fn vint_at(&@u8[] data, uint start) -> tup(uint, uint) {
20+
fn vint_at(&u8[] data, uint start) -> tup(uint, uint) {
2121
auto a = data.(start);
2222
if (a & 0x80u8 != 0u8) { ret tup(a & 0x7fu8 as uint, start + 1u); }
2323
if (a & 0x40u8 != 0u8) {
@@ -40,17 +40,17 @@ fn new_doc(&@u8[] data) -> doc {
4040
}
4141

4242
fn doc_at(&@u8[] data, uint start) -> doc {
43-
auto elt_tag = vint_at(data, start);
44-
auto elt_size = vint_at(data, elt_tag._1);
43+
auto elt_tag = vint_at(*data, start);
44+
auto elt_size = vint_at(*data, elt_tag._1);
4545
auto end = elt_size._1 + elt_size._0;
4646
ret rec(data=data, start=elt_size._1, end=end);
4747
}
4848

4949
fn maybe_get_doc(doc d, uint tg) -> option::t[doc] {
5050
auto pos = d.start;
5151
while (pos < d.end) {
52-
auto elt_tag = vint_at(d.data, pos);
53-
auto elt_size = vint_at(d.data, elt_tag._1);
52+
auto elt_tag = vint_at(*d.data, pos);
53+
auto elt_size = vint_at(*d.data, elt_tag._1);
5454
pos = elt_size._1 + elt_size._0;
5555
if (elt_tag._0 == tg) {
5656
ret some[doc](rec(data=d.data, start=elt_size._1, end=pos));
@@ -72,8 +72,8 @@ fn get_doc(doc d, uint tg) -> doc {
7272
iter docs(doc d) -> tup(uint, doc) {
7373
auto pos = d.start;
7474
while (pos < d.end) {
75-
auto elt_tag = vint_at(d.data, pos);
76-
auto elt_size = vint_at(d.data, elt_tag._1);
75+
auto elt_tag = vint_at(*d.data, pos);
76+
auto elt_size = vint_at(*d.data, elt_tag._1);
7777
pos = elt_size._1 + elt_size._0;
7878
put tup(elt_tag._0, rec(data=d.data, start=elt_size._1, end=pos));
7979
}
@@ -82,8 +82,8 @@ iter docs(doc d) -> tup(uint, doc) {
8282
iter tagged_docs(doc d, uint tg) -> doc {
8383
auto pos = d.start;
8484
while (pos < d.end) {
85-
auto elt_tag = vint_at(d.data, pos);
86-
auto elt_size = vint_at(d.data, elt_tag._1);
85+
auto elt_tag = vint_at(*d.data, pos);
86+
auto elt_size = vint_at(*d.data, elt_tag._1);
8787
pos = elt_size._1 + elt_size._0;
8888
if (elt_tag._0 == tg) {
8989
put rec(data=d.data, start=elt_size._1, end=pos);

0 commit comments

Comments
 (0)