-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Follow-up for canonical se/de after an additional round of review (#588)
* Follow-up for canonical se/de after an additional round of review. - Removed all enum attributes. The manual implementation of the traits can do the same. - Removed `clone` for each `Input` required to call `into_full`. It is possible because of a new `Empty<Type>` type that implements canonical se/de with minimal implementation. - Removed `SIZE_NO_DYNAMIC` because it is not used in the codebase. - Removed `SerializedSizeFixed` because we don't have any specific logic that uses it. - Moved all methods from `SerializedSize` to `Serialize`. It looks unnatural that `#[derive(Serialize)]` implements 3 traits. Instead, it implements on trait now. - Removed `SIZE_STATIC` because it is impossible to calculate in the case of enums(or if the `struct` has an enum field). Supporting something like this requires another way of doing that, plus it doesn't provide a lot of wins for us right now because `#[inline(always]` handle that well enough. - Removed panics during size calculation. Instead we use `saturating_add`. If the size is incorrect we will fail in another place. - Removed usage of `num_enum` and replaced with canonical se/de. - Removed calculation of the discriminant on macro level. Replaced with native rust calculation that covers all cases. * Update CHANGELOG.md * Adddressed comments in the PR
- Loading branch information
Showing
48 changed files
with
564 additions
and
924 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.