Hello everyone!
What am I doing wrong here?
use bevy_math::DVec3;
#[cfg(target_arch = "wasm32")]
use wasm_bindgen::prelude::*;
#[cfg_attr(target_arch = "wasm32", wasm_bindgen)]
pub struct CanNotSkip {
#[cfg_attr(target_arch = "wasm32", wasm_bindgen(skip))]
pub vec: DVec3,
}
If I compile this, I get the following error:
error: expected non-macro attribute, found attribute macro `wasm_bindgen`
--> src/thing.rs:12:40
|
12 | #[cfg_attr(target_arch = "wasm32", wasm_bindgen(skip))]
| ^^^^^^^^^^^^ not a non-macro attribute
But if I remove the cfg_attr
from wasm_bindgen(skip)
it compiles.
#[cfg_attr(target_arch = "wasm32", wasm_bindgen)]
pub struct CanNotSkip {
#[wasm_bindgen(skip)]
pub vec: DVec3,
}
What am I doing wrong?