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

Make ParseError exhaustive #959

Open
alexmozaidze opened this issue Aug 11, 2024 · 1 comment
Open

Make ParseError exhaustive #959

alexmozaidze opened this issue Aug 11, 2024 · 1 comment

Comments

@alexmozaidze
Copy link

alexmozaidze commented Aug 11, 2024

Make ParseError exhaustive. Having it non-exhaustive means that one must add a wild-card to checking for errors, even if it is required to account for all the errors explicitly (having a runtime _ => unreachable!() is not very good). Making it a normal enum allows the user of the library to decide for themselves whether or not they want to wild-card match other cases.

@valenting
Copy link
Collaborator

valenting commented Aug 20, 2024

I believe that's intentional, to future proof that enum.
If it were exhaustive, then consumers must check all errors, so it's impossible to add another ParseError item without breaking crates that are using it.

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

No branches or pull requests

2 participants