Skip to content

Conversation

@dodomorandi
Copy link
Contributor

@dodomorandi dodomorandi commented May 29, 2024

This can be handy to avoid an heap allocation, because it is possible to use the result of the const fn to allocate an array of the right size.

EDIT: I changed a bit the initial proposal in order to make it actually easier to use in const context. Previously encoded_len took a slice (like in the trait), now it takes an usize representing the number of bytes to encode.

@dodomorandi dodomorandi marked this pull request as draft May 29, 2024 14:30
@dodomorandi dodomorandi marked this pull request as ready for review May 29, 2024 14:38
This can be handy to avoid an heap allocation, because it is possible to
use the result of the const fn to allocate an array of the right size.
@tarcieri tarcieri merged commit 56d3775 into RustCrypto:master May 29, 2024
This was referenced Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants