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

Fix issue of type i64 in Rust not properly getting converted to BigInt in TypeScript #858

Conversation

kev-is-dev
Copy link

When compiling livesplit-core to WASM TypeScript from Rust, a compilation error is produced in the resulting index.ts file for the wholeSeconds function. The return type for this function is incorrectly set to number instead of BigInt, this PR corrects that problem by modifying the wasm_bindgen.rs file appropriately.

Admittedly, I don't know much about Rust so I could be handling this wrong, but I believe this is the correct fix and it seems to be working correctly for me. Let me know if I need to make any additional changes to get this working properly again 👍

@CryZe
Copy link
Collaborator

CryZe commented Jan 17, 2025

Thanks, I did notice that recent wasm-bindgen versions apparently changed the way number types are represented, but didn't yet get to fixing that, so thank you. Can you change it for U64 as well? Other than that, this looks good.

@kev-is-dev
Copy link
Author

Thanks, I did notice that recent wasm-bindgen versions apparently changed the way number types are represented, but didn't yet get to fixing that, so thank you. Can you change it for U64 as well? Other than that, this looks good.

Done!

@CryZe CryZe added bug There is a bug. enhancement An improvement for livesplit-core. c api The issue or pull request is about the C API. labels Jan 19, 2025
@CryZe CryZe added this to the v0.14 milestone Jan 19, 2025
@CryZe CryZe enabled auto-merge (squash) January 19, 2025 19:38
@CryZe CryZe merged commit 7cdf265 into LiveSplit:master Jan 19, 2025
70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug There is a bug. c api The issue or pull request is about the C API. enhancement An improvement for livesplit-core.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants