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

HexToArrayError should not wrap HexToBytesError #60

Open
Kixunil opened this issue Jan 27, 2024 · 3 comments
Open

HexToArrayError should not wrap HexToBytesError #60

Kixunil opened this issue Jan 27, 2024 · 3 comments
Labels
1.0 Issues and PRs required or helping to stabilize the API

Comments

@Kixunil
Copy link
Collaborator

Kixunil commented Jan 27, 2024

HexToBytesError contains odd length variant which is unreachable when parsing array - it's just invalid length.

We should put invalid char directly into HexToArrayError and panic during conversion if necessary.

@Kixunil Kixunil added the 1.0 Issues and PRs required or helping to stabilize the API label Jan 27, 2024
@tcharding
Copy link
Member

I agree that the issue is correct but posit that the current code is still technically correct. If fixing as suggested makes the generics any more complicated than they already are then I think it should be left as is.

@Kixunil
Copy link
Collaborator Author

Kixunil commented Jan 29, 2024

I don't see how it has anything to do with generics. Just modify the variants of the enum and panic during conversion. Unless you want to avoid the panic but we can still do that without complicating the public API by calling into an inner function after checking the length which only returns errors for invalid characters.

@tcharding
Copy link
Member

As I suspected this issue is curly. I've had a bunch of goes at it. I am sick right now though.

@tcharding tcharding mentioned this issue Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.0 Issues and PRs required or helping to stabilize the API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants