-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: max_size: various small refactoring
* Change is_zero_size to short-circuit internal all function when first element which isn’t zero sized is found. * Change is_zero_size to use vector of str slices as stack. There’s no need to allocate strings. This also makes it possible to share the same stack as max_serialized_size_impl. * Introduce Recursive error type to better encode error condition of is_zero_size. * Change max_serialized_size’s count argument to NonZeroUsize to encode in type system that the count is in fact never zero. In places where it might end up zero, the function short-circuits.
- Loading branch information
Showing
1 changed file
with
44 additions
and
33 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