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

support primitive arrays in to_rust #97

Merged
merged 9 commits into from
Apr 30, 2024

Conversation

pickleburger
Copy link
Contributor

This PR adds support for primitive arrays in to_rust. The Java array will be converted to a Vec with the corresponding element type.

The element type on the Rust side needs to match the one on the Java side. We use signed values for integral values except for char, which is also unsigned in Java.

  • bool <-> boolean
  • i8 <-> byte
  • i16 <-> short
  • u16 <-> char
  • i32 <-> int
  • i64 <-> long
  • f32 <-> float
  • f64 <-> double

@astonbitecode
Copy link
Owner

Thanks for the PR.

I will try to review it until the end of this week.

Copy link
Owner

@astonbitecode astonbitecode left a comment

Choose a reason for hiding this comment

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

Please see two comments.

rust/src/jni_utils.rs Outdated Show resolved Hide resolved
rust/src/jni_utils.rs Outdated Show resolved Hide resolved
@astonbitecode astonbitecode merged commit 612a762 into astonbitecode:master Apr 30, 2024
6 checks passed
@astonbitecode
Copy link
Owner

Seems nice. Thank you!

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.

2 participants