diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0cce331..9193abe 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -8,6 +8,7 @@ on: env: CARGO_TERM_COLOR: always + RUSTFLAGS: --cfg=web_sys_unstable_apis jobs: build: @@ -19,7 +20,7 @@ jobs: - name: Setup rust environment run: rustup target add wasm32-unknown-unknown - name: Build WASM - run: RUSTFLAGS=--cfg=web_sys_unstable_apis cargo build --verbose --target wasm32-unknown-unknown + run: cargo build --verbose --target wasm32-unknown-unknown - name: Build Native (Linux) run: cargo build --verbose --target x86_64-unknown-linux-gnu - name: Run clippy diff --git a/Cargo.toml b/Cargo.toml index 94ad8e5..bacf2e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cross_usb" -version = "0.3.2" +version = "0.3.3" authors = ["G2-Games "] repository = "https://github.com/G2-Games/cross-usb" documentation = "https://docs.rs/cross_usb" diff --git a/src/lib.rs b/src/lib.rs index 43faa5e..cb8847a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,6 +16,10 @@ //! is merged into wasm bindgen, getting a list of USB devices is not possible on WASM //! targets. However, this isn't a huge deal as the user gets a list to select from anyway. //! +//! * When compiling this crate on a WASM target, you must use either +//! `RUSTFLAGS=--cfg=web_sys_unstable_apis` or by passing the argument in a +//! `.cargo/config.toml` file. Read more here: https://rustwasm.github.io/wasm-bindgen/web-sys/unstable-apis.html +//! //! ## Example: //! ```no_run //! # tokio_test::block_on(async {