decode option event arg (#158)

Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
This commit is contained in:
Greg Hill
2020-09-07 14:58:45 +01:00
committed by GitHub
parent af45c39fb1
commit e85d01ed08
2 changed files with 22 additions and 0 deletions
+11
View File
@@ -154,6 +154,17 @@ impl<T: System> EventsDecoder<T> {
self.decode_raw_bytes(&[*arg.clone()], input, output)?
}
}
EventArg::Option(arg) => {
match input.read_byte()? {
0 => (),
1 => self.decode_raw_bytes(&[*arg.clone()], input, output)?,
_ => {
return Err(Error::Other(
"unexpected first byte decoding Option".into(),
))
}
}
}
EventArg::Tuple(args) => self.decode_raw_bytes(args, input, output)?,
EventArg::Primitive(name) => {
let result = match name.as_str() {