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 TryFrom<JsValue>
for [iu](64|128)
#3058
Conversation
4db501d
to
d285246
Compare
Adds a way to convert `JsValue` or a `BigInt` to `i64`/`u64`/`i128`/`u128` with type and range checks, returning the original `JsValue` otherwise. This could be optimised a little bit further via more intrinsics, but it's good enough for the initial implementation, so leaving any optimisations for the future. Fixes rustwasm#2350.
6f61ffc
to
12ffc2b
Compare
Rebased. |
f74e568
to
3b42e9e
Compare
Any chance for a release sometime soon? I want to release new version of serde-wasm-bindgen that would depend on this PR + #3049. |
v0.2.83 already includes those changes. (It doesn't seem to have been added as a proper GitHub release.) |
Ahh yeah that's what I was tracking / checking regularly, so missed a release. |
Why not also adding |
They are more complicated / would make a bit less sense because they're all represented by a generic You can always convert from |
Adds a way to convert
JsValue
or aBigInt
toi64
/u64
/i128
/u128
with type and range checks, returning the originalJsValue
otherwise.This could be optimised a little bit further via more intrinsics, but it's good enough for the initial implementation, so leaving any optimisations for the future.
Fixes #2350.