Skip to content

Commit 7caeb31

Browse files
Fix non-compliling examples (#2624)
* Fix non-compliling examples * Add CI job to run cargo check (to ensure examples don't break in the future)
1 parent 872c57e commit 7caeb31

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

azure-pipelines.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ jobs:
1111
- template: ci/azure-install-rust.yml
1212
- script: cargo fmt --all -- --check
1313

14+
- job: cargo_check
15+
displayName: "Run cargo check"
16+
steps:
17+
- template: ci/azure-install-rust.yml
18+
- script: cargo check --all
19+
1420
- job: test_wasm_bindgen
1521
displayName: "Run wasm-bindgen crate tests (unix)"
1622
steps:

examples/guide-supported-types-examples/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ crate-type = ["cdylib"]
99

1010
[dependencies]
1111
wasm-bindgen = "0.2.74"
12+
js-sys = "0.3.51"

examples/guide-supported-types-examples/src/imported_types.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
use wasm_bindgen::prelude::*;
22

33
#[wasm_bindgen]
4+
#[derive(Copy, Clone, Debug)]
45
pub enum NumberEnum {
56
Foo = 0,
67
Bar = 1,
78
Qux = 2,
89
}
910

1011
#[wasm_bindgen]
12+
#[derive(Copy, Clone, Debug)]
1113
pub enum StringEnum {
1214
Foo = "foo",
1315
Bar = "bar",

examples/webxr/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(web_sys_unstable_apis)]
2+
13
#[macro_use]
24
mod utils;
35

0 commit comments

Comments
 (0)