Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

password-hash: make Ident::new fallible; add Ident::new_unwrap #960

Merged
merged 1 commit into from
Mar 9, 2022

Conversation

tarcieri
Copy link
Member

@tarcieri tarcieri commented Mar 9, 2022

Unifies the const fn implementation of Ident::new and TryFrom, with the former now able to return a result thanks to const panic.

Since Debug isn't const-friendly yet and therefore Result::unwrap cannot be used in const contexts, adds a ::new_unwrap function as a stopgap. It performs some pattern matching and uses const panic to handle the Err case.

Unifies the `const fn` implementation of `Ident::new` and `TryFrom`,
with the former now able to return a result thanks to const panic.

Since `Debug` isn't const-friendly yet and therefore `Result::unwrap`
cannot be used in const contexts, adds a `::new_unwrap` function as a
stopgap. It performs some pattern matching and uses const panic to
handle the `Err` case.
@tarcieri tarcieri merged commit d728dda into master Mar 9, 2022
@tarcieri tarcieri deleted the password-hash/fallible-ident-new branch March 9, 2022 18:18
@tarcieri tarcieri mentioned this pull request Mar 9, 2022
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.

1 participant