Closed tatsuya6502 closed 8 years ago
Forgot to mention about the versions:
I agree with you. Can you submit your change as a PR?
Thank you for the prompt reply! I submitted the PR https://github.com/goertzenator/ruster_unsafe/pull/9.
And thank you for the PR. Also, I'm pleased to see that this works on FreeBSD.
I am trying to port vinoski/bitwise NIF examples to Rust, but I found that Rust compiler does not let me update the contents of the
data
field ofErlNifBinary
.I am not totally sure as I just started to play with Rust a few days ago, but it looks like the
data
field should be defined as*mut u8
instead of*const u8
?ruster_unsafe/src/lib.rs
Here is relevant code from my program. (Ported from bitwise_nif.c#L14-L38)
And the compile error:
If I change the
data
field to*mut u8
, it will compile.