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

Add serde support #38

Merged
merged 2 commits into from
Oct 22, 2023
Merged

Add serde support #38

merged 2 commits into from
Oct 22, 2023

Conversation

widberg
Copy link
Contributor

@widberg widberg commented Sep 25, 2023

Basic Serialize and Deserialize implementations for UInt<T, BITS> with graceful error handling and tests, gated by serde feature. A step towards closing hecatia-elegua/bilge#74.

@danlehmann danlehmann requested a review from mist64 September 26, 2023 18:34
@hecatia-elegua
Copy link
Collaborator

looks solid, but does serde not have some kind of error so we would not need InvalidUIntValueError?
(I have not looked into it)

@danlehmann
Copy link
Owner

Apologies for the slow response! (I originally got this patch while I was on vacation and lost track of it when I returned).

But apologies aside, I've been trying to find a reviewer this morning (as I don't really know serde) - I'd like to merge this asap. If no one is willing to do it, I'll have to read up a bit on serde

@widberg
Copy link
Contributor Author

widberg commented Oct 16, 2023

looks solid, but does serde not have some kind of error so we would not need InvalidUIntValueError? (I have not looked into it)

If you can find a way to make Serde's Unexpected take a 128-bit int I'd be happy to do that, but as far as I can see it only takes a 64-bit int. This is because 128-bit support in Serde came later and changing the API now would require a bump in the major version number. The InvalidUIntValueError was my solution to this but I'm open to ideas :)

@hecatia-elegua
Copy link
Collaborator

@widberg oh sorry, you have commented that in code. I think it's a good solution :)

Copy link
Owner

@danlehmann danlehmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution and sorry for being so slow!

@danlehmann danlehmann merged commit 493f0fd into danlehmann:main Oct 22, 2023
@danlehmann
Copy link
Owner

I'll enable the github tests in a follow-up

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