-
-
Notifications
You must be signed in to change notification settings - Fork 411
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
Implement i128/u128 to JsBigInt conversions #3129
Conversation
This commit implements trait conversions to JsValue for i128/u128. This addresses #1970
Hmmm I'm not sure if we want to do this. There is no native type in JavaScript equivalent to i/u128. And using a BigInt is not the same thing, since it's stored in the heap and performance is different. I could see a TryFrom implementation that tries to convert it to an i32, though. Or to an f64 if there is no precision loss. But in general, I wouldn't do this conversion, different users might have different thoughts on how should this work. |
Note that this PR implements |
I'd support merging this change. Converting to |
Codecov Report
@@ Coverage Diff @@
## main #3129 +/- ##
==========================================
- Coverage 50.65% 50.61% -0.04%
==========================================
Files 444 444
Lines 42661 42696 +35
==========================================
+ Hits 21608 21612 +4
- Misses 21053 21084 +31
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! just some small nitpicks :)
Co-authored-by: Haled Odat <[email protected]>
This commit implements trait conversions to JsValue for i128/u128. This addresses #1970
This Pull Request fixes/closes #{1970}.
It changes the following: