naia-lib / naia

a cross-platform (including Wasm!) networking library built in Rust. Intended to make multiplayer game development dead-simple & lightning-fast
Apache License 2.0
857 stars 61 forks source link

Can't use array in Message #151

Closed BrandonDyer64 closed 1 year ago

BrandonDyer64 commented 1 year ago

This code fails:

#[derive(Message)]
pub struct TestMessage {
    pub data: [f32; 16],
}
error[E0063]: missing field `data` in initializer of `video_packet::TestMessage`
  --> portal_cloud_protocol_net/src/messages/video_packet.rs:11:12
   |
11 | pub struct TestMessage {
   |            ^^^^^^^^^^^ missing `data`

For more information about this error, try `rustc --explain E0063`.

Same thing happens if I try to use a tuple.

connorcarpenter commented 1 year ago

This should be fixed in the 0.19.1 release of the naia-derive crate, published in the recent release: https://github.com/naia-lib/naia/releases/tag/v0.20.2.

If I understand cargo correctly, your project should pull this change in automatically.

Thank you for the heads up! :pray: