fix start section not pushing it's length

This commit is contained in:
NikVolf
2017-06-02 19:59:29 +03:00
parent cec6131c3b
commit bc69c680ee

View File

@ -157,7 +157,9 @@ impl Serialize for Section {
},
Section::Start(index) => {
VarUint7::from(0x08).serialize(writer)?;
VarUint32::from(index).serialize(writer)?;
let mut counted_writer = CountedWriter::new(writer);
VarUint32::from(index).serialize(&mut counted_writer)?;
counted_writer.done()?;
},
Section::Element(element_section) => {
VarUint7::from(0x09).serialize(writer)?;