-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The current API for const-decoding only returns the resulting array, which makes it impossible for a user to check that the input had the correct length. This is an important use-case for things like wallet addresses, where people often make typos by forgetting to paste a character. Since there's no `onto()` API available in const contexts, this PR introduces a breaking change by having `into_array_const` also return the length decoded. I couldn't come up with a way to eliminate the breaking change without also introducing a lot of copied code, since we can't call `Result::map` in a const context. I apologize for coming back with another change so soon, but I only discovered the issue when playing around with the API more recently. Let me know what you think!
- Loading branch information
Showing
2 changed files
with
48 additions
and
9 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