Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid Vec allocation in Event::data derived implementation
Rather than creating a Vec with the discriminant, then another where the event object is serialised, to finally merge the two, construct a temporary `(discriminant, event)` tuple which can be serialised by borsh in one go. This avoids the temporary vector allocation and also simplifies the code. While at it, make other minor refactoring to the event derive function.
- Loading branch information