Skip to content

Commit

Permalink
Fix zero sized types.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvc94ch committed Jun 4, 2020
1 parent 26ada75 commit 12da329
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,8 @@ impl<T: System> EventsDecoder<T> {
U: Default + Codec + Send + 'static,
{
let size = U::default().encode().len();
if size > 0 {
self.type_sizes.insert(name.to_string(), size);
Ok(size)
} else {
Err(EventsError::TypeSizeUnavailable(name.to_owned()))
}
self.type_sizes.insert(name.to_string(), size);
Ok(size)
}

/// Check missing type sizes.
Expand Down

0 comments on commit 12da329

Please sign in to comment.