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

Uupdate js value covnersion #397

Merged

Conversation

Sharktheone
Copy link
Member

This PR mainly adds another trait IntoRustValue, which can convert JSValues into the correct Rust types. Because of that ValueConversion was renamed to IntoJSValue

This makes it way easier to convert JSValues to Rust values in the macro I want to write. I decided to make a separate PR for that because it doesn't really fit to the macro things.

Secondly, slices and Vecs can be can be converted to a JSArray and back.
JSArray can also be converted to JSValue and Vec<JSValue>

Finally, I removed the `#[allow(X)] macros and fixed the warnings generated by that.

Next Steps

@Sharktheone Sharktheone added the javascript Any issues related to JavaScript label Mar 2, 2024
@Sharktheone Sharktheone requested a review from jaytaph March 2, 2024 17:07
@Sharktheone Sharktheone self-assigned this Mar 2, 2024
@Sharktheone Sharktheone merged commit fa958da into gosub-io:main Mar 3, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Any issues related to JavaScript
Projects
Status: 🎯 Done
Development

Successfully merging this pull request may close these issues.

2 participants