mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-06-12 22:41:40 +00:00
working sections parse
This commit is contained in:
@ -10,9 +10,12 @@ impl Deserialize for Section {
|
||||
type Error = Error;
|
||||
|
||||
fn deserialize<R: io::Read>(reader: &mut R) -> Result<Self, Self::Error> {
|
||||
let id = VarUint7::deserialize(reader)?;
|
||||
let id = match VarUint7::deserialize(reader) {
|
||||
// todo: be more selective detecting no more section
|
||||
Err(_) => { return Err(Error::UnexpectedEof); },
|
||||
Ok(id) => id,
|
||||
};
|
||||
let unparsed = Unparsed::deserialize(reader)?;
|
||||
|
||||
Ok(Section {
|
||||
id: id.0,
|
||||
unparsed: unparsed,
|
||||
|
Reference in New Issue
Block a user